sim: constify arg to sim_do_command
[deliverable/binutils-gdb.git] / sim / ppc / emul_unix.c
index d5e56296105d6c7f8a17dfd6f35af274d18129c4..d72525d8b01de0ed5d21db1e85158d5263cd355e 100644 (file)
@@ -4,7 +4,7 @@
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
+    the Free Software Foundation; either version 3 of the License, or
     (at your option) any later version.
 
     This program is distributed in the hope that it will be useful,
@@ -13,8 +13,7 @@
     GNU General Public License for more details.
 
     You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+    along with this program; if not, see <http://www.gnu.org/licenses/>.
 
     */
 
@@ -240,7 +239,7 @@ do_unix_read(os_emul_data *emul,
   if (status > 0)
     emul_write_buffer(scratch_buffer, buf, status, processor, cia);
 
-  zfree(scratch_buffer);
+  free(scratch_buffer);
 }
 
 
@@ -270,7 +269,7 @@ do_unix_write(os_emul_data *emul,
   /* write */
   status = write(d, scratch_buffer, nbytes);
   emul_write_status(processor, status, errno);
-  zfree(scratch_buffer);
+  free(scratch_buffer);
 
   flush_stdoutput();
 }
@@ -730,7 +729,11 @@ do_unix_mkdir(os_emul_data *emul,
   if (WITH_TRACE && ppc_trace[trace_os_emul])
     printf_filtered ("0x%lx [%s], 0%3o", (long)path_addr, path, mode);
 
+#ifdef USE_WIN32API
+  status = mkdir(path);
+#else
   status = mkdir(path, mode);
+#endif
   emul_write_status(processor, status, errno);
 }
 #endif
@@ -947,6 +950,7 @@ emul_unix_create(device *root,
   int elf_binary;
   os_emul_data *data;
   device *vm;
+  char *filename;
 
   /* merge any emulation specific entries into the device tree */
 
@@ -975,8 +979,10 @@ emul_unix_create(device *root,
             (unsigned long)(top_of_stack - stack_size));
   tree_parse(vm, "./nr-bytes 0x%x", stack_size);
 
+  filename = tree_quote_property (bfd_get_filename(image));
   tree_parse(root, "/openprom/vm/map-binary/file-name %s",
-            bfd_get_filename(image));
+            filename);
+  free (filename);
 
   /* finish the init */
   tree_parse(root, "/openprom/init/register/pc 0x%lx",
@@ -1027,6 +1033,11 @@ typedef  unsigned32      solaris_nlink_t;
 #ifdef HAVE_SYS_STAT_H
 #define        SOLARIS_ST_FSTYPSZ 16           /* array size for file system type name */
 
+/* AIX 7.1 defines st_pad[123] to st_[amc]tim.tv_pad, respectively */
+#undef st_pad1
+#undef st_pad2
+#undef st_pad3
+
 struct solaris_stat {
   solaris_dev_t                st_dev;
   signed32             st_pad1[3];     /* reserved for network id */
This page took 0.025617 seconds and 4 git commands to generate.