[MLton-commit] r4307
Matthew Fluet
MLton@mlton.org
Wed, 25 Jan 2006 19:07:02 -0800
More unified c-side/ml-side basis functions
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
A mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/FileSys-consts.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Stat.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Utimbuf.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/access.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chdir.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chmod.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chown.c
A mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fchdir.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fchmod.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fchown.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fpathconf.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/ftruncate.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/getcwd.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/link.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/mkdir.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/mkfifo.c
D mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open.c
A mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open2.c
A mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open3.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/pathconf.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/readlink.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/rename.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/rmdir.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/symlink.c
A mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/truncate.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/umask.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/unlink.c
A mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/FLock-consts.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/FLock.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/close.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/dup.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/dup2.c
A mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fcntl-consts.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fcntl2.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fcntl3.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fsync.c
A mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/lseek-consts.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/lseek.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/pipe.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/read.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/write.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/ProcEnv.c
A mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Times.c
D mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Tms.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Uname.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/environ.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getenv.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getgroups.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getlogin.c
D mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getpgrp.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/isatty.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setenv.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setgroups.c
A mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/sysconf-consts.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/sysconf.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/ttyname.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/alarm.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/exece.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/execp.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/exit.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/exitStatus.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/fork.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/ifExited.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/ifSignaled.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/ifStopped.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/kill.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/nanosleep.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/pause.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/sleep.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/stopSig.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/system.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/termSig.c
A mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/waitpid-consts.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/waitpid.c
A mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal-consts.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/SysDB/Group.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/SysDB/Passwd.c
U mlton/branches/on-20050822-x86_64-branch/runtime/TODO
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Process/spawne.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Process/spawnp.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetHostDB.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/INetSock.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/Socket.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/UnixSock.c
D mlton/branches/on-20050822-x86_64-branch/runtime/basis/Ptrace.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/gdtoa.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Stdio.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/Date.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/OS/IO/poll.c
U mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def
U mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-basis-ffi.sml
U mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-types.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.h
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.h
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/freebsd.h
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.h
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.h
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.h
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.h
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/solaris.h
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/windows.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform.h
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-01-26 03:06:35 UTC (rev 4307)
@@ -51,7 +51,7 @@
endif
CC = gcc -std=gnu99
-CFLAGS = -Wall -I. -Iplatform -D_FILE_OFFSET_BITS=64 $(FLAGS)
+CFLAGS = -Wall -I. -Iplatform $(FLAGS)
OPTCFLAGS = $(CFLAGS) -O2 $(OPTFLAGS)
DEBUGCFLAGS = $(CFLAGS) -gstabs+ -g2 -O1 -DASSERT=1
WARNFLAGS = -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function \
Added: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/FileSys-consts.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/FileSys-consts.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/FileSys-consts.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -0,0 +1,75 @@
+#include "platform.h"
+
+const C_Int_t Posix_FileSys_A_F_OK = F_OK;
+const C_Int_t Posix_FileSys_A_R_OK = R_OK;
+const C_Int_t Posix_FileSys_A_W_OK = W_OK;
+const C_Int_t Posix_FileSys_A_X_OK = X_OK;
+
+const C_Int_t Posix_FileSys_O_RDONLY = O_RDONLY;
+const C_Int_t Posix_FileSys_O_RDWR = O_RDWR;
+const C_Int_t Posix_FileSys_O_WRONLY = O_WRONLY;
+
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
+#ifndef O_TEXT
+#define O_TEXT 0
+#endif
+
+const C_Int_t Posix_FileSys_O_APPEND = O_APPEND;
+const C_Int_t Posix_FileSys_O_BINARY = O_BINARY;
+const C_Int_t Posix_FileSys_O_CREAT = O_CREAT;
+const C_Int_t Posix_FileSys_O_DSYNC = O_DSYNC;
+const C_Int_t Posix_FileSys_O_EXCL = O_EXCL;
+const C_Int_t Posix_FileSys_O_NOCTTY = O_NOCTTY;
+const C_Int_t Posix_FileSys_O_NONBLOCK = O_NONBLOCK;
+const C_Int_t Posix_FileSys_O_RSYNC = O_RSYNC;
+const C_Int_t Posix_FileSys_O_SYNC = O_SYNC;
+const C_Int_t Posix_FileSys_O_TEXT = O_TEXT;
+const C_Int_t Posix_FileSys_O_TRUNC = O_TRUNC;
+
+const C_Int_t Posix_FileSys_PC_FILESIZEBITS = _PC_FILESIZEBITS;
+const C_Int_t Posix_FileSys_PC_LINK_MAX = _PC_LINK_MAX;
+const C_Int_t Posix_FileSys_PC_MAX_CANON = _PC_MAX_CANON;
+const C_Int_t Posix_FileSys_PC_MAX_INPUT = _PC_MAX_INPUT;
+const C_Int_t Posix_FileSys_PC_NAME_MAX = _PC_NAME_MAX;
+const C_Int_t Posix_FileSys_PC_PATH_MAX = _PC_PATH_MAX;
+const C_Int_t Posix_FileSys_PC_PIPE_BUF = _PC_PIPE_BUF;
+const C_Int_t Posix_FileSys_PC_2_SYMLINKS = _PC_2_SYMLINKS;
+const C_Int_t Posix_FileSys_PC_ALLOC_SIZE_MIN = _PC_ALLOC_SIZE_MIN;
+const C_Int_t Posix_FileSys_PC_REC_INCR_XFER_SIZE = _PC_REC_INCR_XFER_SIZE;
+const C_Int_t Posix_FileSys_PC_REC_MAX_XFER_SIZE = _PC_REC_MAX_XFER_SIZE;
+const C_Int_t Posix_FileSys_PC_REC_MIN_XFER_SIZE = _PC_REC_MIN_XFER_SIZE;
+const C_Int_t Posix_FileSys_PC_REC_XFER_ALIGN = _PC_REC_XFER_ALIGN;
+const C_Int_t Posix_FileSys_PC_SYMLINK_MAX = _PC_SYMLINK_MAX;
+const C_Int_t Posix_FileSys_PC_CHOWN_RESTRICTED = _PC_CHOWN_RESTRICTED;
+const C_Int_t Posix_FileSys_PC_NO_TRUNC = _PC_NO_TRUNC;
+const C_Int_t Posix_FileSys_PC_VDISABLE = _PC_VDISABLE;
+const C_Int_t Posix_FileSys_PC_ASYNC_IO = _PC_ASYNC_IO;
+const C_Int_t Posix_FileSys_PC_PRIO_IO = _PC_PRIO_IO;
+const C_Int_t Posix_FileSys_PC_SYNC_IO = _PC_SYNC_IO;
+
+const C_Mode_t Posix_FileSys_S_IFBLK = S_IFBLK;
+const C_Mode_t Posix_FileSys_S_IFCHR = S_IFCHR;
+const C_Mode_t Posix_FileSys_S_IFDIR = S_IFDIR;
+const C_Mode_t Posix_FileSys_S_IFIFO = S_IFIFO;
+const C_Mode_t Posix_FileSys_S_IFLNK = S_IFLNK;
+const C_Mode_t Posix_FileSys_S_IFMT = S_IFMT;
+const C_Mode_t Posix_FileSys_S_IFREG = S_IFREG;
+const C_Mode_t Posix_FileSys_S_IFSOCK = S_IFSOCK;
+const C_Mode_t Posix_FileSys_S_IRGRP = S_IRGRP;
+const C_Mode_t Posix_FileSys_S_IROTH = S_IROTH;
+const C_Mode_t Posix_FileSys_S_IRUSR = S_IRUSR;
+const C_Mode_t Posix_FileSys_S_IRWXG = S_IRWXG;
+const C_Mode_t Posix_FileSys_S_IRWXO = S_IRWXO;
+const C_Mode_t Posix_FileSys_S_IRWXU = S_IRWXU;
+const C_Mode_t Posix_FileSys_S_ISGID = S_ISGID;
+const C_Mode_t Posix_FileSys_S_ISUID = S_ISUID;
+const C_Mode_t Posix_FileSys_S_ISVTX = S_ISVTX;
+const C_Mode_t Posix_FileSys_S_IWGRP = S_IWGRP;
+const C_Mode_t Posix_FileSys_S_IWOTH = S_IWOTH;
+const C_Mode_t Posix_FileSys_S_IWUSR = S_IWUSR;
+const C_Mode_t Posix_FileSys_S_IXGRP = S_IXGRP;
+const C_Mode_t Posix_FileSys_S_IXOTH = S_IXOTH;
+const C_Mode_t Posix_FileSys_S_IXUSR = S_IXUSR;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Stat.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Stat.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Stat.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -46,6 +46,7 @@
return statbuf.st_ctime;
}
+/*
C_BlkSize_t Posix_FileSys_Stat_getBlkSize (void) {
return statbuf.st_blksize;
}
@@ -53,6 +54,7 @@
C_BlkCnt_t Posix_FileSys_Stat_getBlkCnt (void) {
return statbuf.st_blocks;
}
+*/
C_Errno_t(C_Int_t) Posix_FileSys_Stat_fstat (C_Fd_t f) {
return fstat (f, &statbuf);
@@ -63,5 +65,5 @@
}
C_Errno_t(C_Int_t) Posix_FileSys_Stat_stat (NullString8_t f) {
- return stat ((char*)f, &statbuf);
+ return stat ((const char*)f, &statbuf);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Utimbuf.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Utimbuf.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Utimbuf.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -2,14 +2,14 @@
static struct utimbuf utimbuf;
-void Posix_FileSys_Utimbuf_setActime (Int i) {
- utimbuf.actime = i;
+void Posix_FileSys_Utimbuf_setAcTime (C_Time_t t) {
+ utimbuf.actime = t;
}
-void Posix_FileSys_Utimbuf_setModTime (Int i) {
- utimbuf.modtime = i;
+void Posix_FileSys_Utimbuf_setModTime (C_Time_t t) {
+ utimbuf.modtime = t;
}
-Int Posix_FileSys_Utimbuf_utime (Pointer s) {
- return (Int)utime((char *)s, &utimbuf);
+C_Errno_t(C_Int_t) Posix_FileSys_Utimbuf_utime (NullString8_t s) {
+ return utime((const char *)s, &utimbuf);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/access.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/access.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/access.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_access (Pointer f, Word w) {
- return access ((char *) f, w);
+C_Errno_t(C_Int_t) Posix_FileSys_access (NullString8_t f, C_Int_t i) {
+ return access ((const char *) f, i);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chdir.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chdir.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chdir.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_chdir(Pointer p) {
- return chdir((char *) p);
+C_Errno_t(C_Int_t) Posix_FileSys_chdir(NullString8_t p) {
+ return chdir((const char *) p);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chmod.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chmod.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chmod.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_chmod (Pointer p, Mode m) {
- return chmod ((char *) p, m);
+C_Errno_t(C_Int_t) Posix_FileSys_chmod (NullString8_t p, C_Mode_t m) {
+ return chmod ((const char *) p, m);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chown.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chown.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chown.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_chown (Pointer p, Uid u, Gid g) {
- return chown ((char *) p, u, g);
+C_Errno_t(C_Int_t) Posix_FileSys_chown (NullString8_t p, C_UId_t u, C_GId_t g) {
+ return chown ((const char *) p, u, g);
}
Copied: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fchdir.c (from rev 4304, mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chdir.c)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chdir.c 2006-01-24 02:49:37 UTC (rev 4304)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fchdir.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -0,0 +1,5 @@
+#include "platform.h"
+
+C_Errno_t(C_Int_t) Posix_FileSys_fchdir(C_Fd_t f) {
+ return fchdir(f);
+}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fchmod.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fchmod.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fchmod.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_fchmod (Fd f, Mode m) {
- return fchmod (f, m);
+C_Errno_t(C_Int_t) Posix_FileSys_fchmod (C_Fd_t f, C_Mode_t m) {
+ return fchmod (f, m);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fchown.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fchown.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fchown.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_fchown (Fd f, Uid u, Gid g) {
- return fchown (f, u, g);
+C_Errno_t(C_Int_t) Posix_FileSys_fchown (C_Fd_t f, C_UId_t u, C_GId_t g) {
+ return fchown (f, u, g);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fpathconf.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fpathconf.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fpathconf.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_fpathconf (Fd f, Int n) {
- return fpathconf (f, n);
+C_Errno_t(C_Long_t) Posix_FileSys_fpathconf (C_Fd_t f, C_Int_t n) {
+ return fpathconf (f, n);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/ftruncate.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/ftruncate.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/ftruncate.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_ftruncate (Fd f, Position n) {
- return ftruncate (f, n);
+C_Errno_t(C_Int_t) Posix_FileSys_ftruncate (C_Fd_t f, C_Off_t n) {
+ return ftruncate (f, n);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/getcwd.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/getcwd.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/getcwd.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,6 +1,6 @@
#include "platform.h"
-Cstring Posix_FileSys_getcwd (Pointer buf, Size n) {
- char *res = getcwd ((char*)buf, n);
- return (Cstring)res;
+C_String_t Posix_FileSys_getcwd (Array(Char8_t) buf, C_Size_t n) {
+ char *res = getcwd ((char*)buf, n);
+ return (C_String_t)res;
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/link.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/link.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/link.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_link (Pointer p1, Pointer p2) {
- return link ((char *) p1, (char *) p2);
+C_Errno_t(C_Int_t) Posix_FileSys_link (NullString8_t p1, NullString8_t p2) {
+ return link ((const char *) p1, (const char *) p2);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/mkdir.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/mkdir.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/mkdir.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_mkdir (Pointer p, Word w) {
- return mkdir2 ((char *) p, w);
+C_Errno_t(C_Int_t) Posix_FileSys_mkdir (NullString8_t p, C_Mode_t m) {
+ return mkdir ((const char *) p, m);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/mkfifo.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/mkfifo.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/mkfifo.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_mkfifo (Pointer p, Word w) {
- return mkfifo ((char *) p, w);
+C_Errno_t(C_Int_t) Posix_FileSys_mkfifo (NullString8_t p, C_Mode_t m) {
+ return mkfifo ((const char *) p, m);
}
Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,19 +0,0 @@
-#include "platform.h"
-
-#ifndef DEBUG
-#define DEBUG FALSE
-#endif
-
-Int Posix_FileSys_open (Pointer p, Word w, Mode m) {
- Int res;
-
- res = open ((char *) p, w, m);
-
- if (DEBUG)
- fprintf (stderr, "%d = Posix_FileSys_open (%s, 0x%08x, 0x%08x)\n",
- (int)res,
- (char *)p,
- (unsigned int)w,
- (unsigned int)m);
- return res;
-}
Copied: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open2.c (from rev 4304, mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open.c)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open.c 2006-01-24 02:49:37 UTC (rev 4304)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open2.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -0,0 +1,5 @@
+#include "platform.h"
+
+C_Errno_t(C_Fd_t) Posix_FileSys_open2 (NullString8_t p, C_Int_t i) {
+ return open ((const char*)p, i);
+}
Copied: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open3.c (from rev 4304, mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open.c)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open.c 2006-01-24 02:49:37 UTC (rev 4304)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open3.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -0,0 +1,5 @@
+#include "platform.h"
+
+C_Errno_t(C_Fd_t) Posix_FileSys_open3 (NullString8_t p, C_Int_t i, C_Mode_t m) {
+ return open ((const char*)p, i, (mode_t)m);
+}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/pathconf.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/pathconf.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/pathconf.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_pathconf (Pointer p, Int n) {
- return pathconf ((char *)p, n);
+C_Errno_t(C_Long_t) Posix_FileSys_pathconf (NullString8_t p, C_Int_t n) {
+ return pathconf ((const char *)p, n);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/readlink.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/readlink.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/readlink.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_readlink (Pointer p, Pointer b, Int n) {
- return readlink ((char*)p, (char*)b, n);
+C_Errno_t(C_SSize_t) Posix_FileSys_readlink (NullString8_t p, Array(Char8_t) b, C_Size_t n) {
+ return readlink ((const char*)p, (char*)b, n);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/rename.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/rename.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/rename.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_rename (Pointer p1, Pointer p2) {
- return rename ((char *) p1, (char *) p2);
+C_Errno_t(C_Int_t) Posix_FileSys_rename (NullString8_t p1, NullString8_t p2) {
+ return rename ((const char*) p1, (const char*) p2);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/rmdir.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/rmdir.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/rmdir.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_rmdir (Pointer p) {
- return rmdir ((char *) p);
+C_Errno_t(C_Int_t) Posix_FileSys_rmdir (NullString8_t p) {
+ return rmdir ((const char*) p);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/symlink.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/symlink.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/symlink.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_symlink (Pointer p1, Pointer p2) {
- return symlink ((char *) p1, (char *) p2);
+C_Errno_t(C_Int_t) Posix_FileSys_symlink (NullString8_t p1, NullString8_t p2) {
+ return symlink ((const char*) p1, (const char*) p2);
}
Copied: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/truncate.c (from rev 4304, mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/ftruncate.c)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/ftruncate.c 2006-01-24 02:49:37 UTC (rev 4304)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/truncate.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -0,0 +1,5 @@
+#include "platform.h"
+
+C_Errno_t(C_Int_t) Posix_FileSys_truncate (NullString8_t p, C_Off_t n) {
+ return truncate ((const char*)p, n);
+}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/umask.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/umask.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/umask.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Word Posix_FileSys_umask (Word w) {
- return umask (w);
+C_Mode_t Posix_FileSys_umask (C_Mode_t m) {
+ return umask (m);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/unlink.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/unlink.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/unlink.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Word Posix_FileSys_unlink (Pointer p) {
- return unlink ((char *) p);
+C_Errno_t(C_Int_t) Posix_FileSys_unlink (NullString8_t p) {
+ return unlink ((const char*) p);
}
Added: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/FLock-consts.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/FLock-consts.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/FLock-consts.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -0,0 +1,5 @@
+#include "platform.h"
+
+const C_Int_t Posix_IO_FLock_F_GETLK = F_GETLK;
+const C_Int_t Posix_IO_FLock_F_SETLK = F_SETLK;
+const C_Int_t Posix_IO_FLock_F_SETLKW = F_SETLKW;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/FLock.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/FLock.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/FLock.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -2,46 +2,46 @@
static struct flock s_flock;
-Int Posix_IO_FLock_fcntl (Fd f, Int cmd) {
- return fcntl (f, cmd, (int)&s_flock);
+C_Errno_t(C_Int_t) Posix_IO_FLock_fcntl (C_Fd_t f, C_Int_t cmd) {
+ return fcntl (f, cmd, &s_flock);
}
-Int Posix_IO_FLock_type () {
- return s_flock.l_type;
+C_Short_t Posix_IO_FLock_getType (void) {
+ return s_flock.l_type;
}
-Int Posix_IO_FLock_whence () {
- return s_flock.l_whence;
+C_Short_t Posix_IO_FLock_getWhence (void) {
+ return s_flock.l_whence;
}
-Position Posix_IO_FLock_start () {
- return s_flock.l_start;
+C_Off_t Posix_IO_FLock_getStart (void) {
+ return s_flock.l_start;
}
-Position Posix_IO_FLock_len () {
+C_Off_t Posix_IO_FLock_getLen (void) {
return s_flock.l_len;
}
-Int Posix_IO_FLock_pid () {
+C_PId_t Posix_IO_FLock_getPId (void) {
return s_flock.l_pid;
}
-void Posix_IO_FLock_setType (Int x) {
- s_flock.l_type = x;
+void Posix_IO_FLock_setType (C_Short_t x) {
+ s_flock.l_type = x;
}
-void Posix_IO_FLock_setWhence (Int x) {
- s_flock.l_whence = x;
+void Posix_IO_FLock_setWhence (C_Short_t x) {
+ s_flock.l_whence = x;
}
-void Posix_IO_FLock_setStart (Position x) {
- s_flock.l_start = x;
+void Posix_IO_FLock_setStart (C_Off_t x) {
+ s_flock.l_start = x;
}
-void Posix_IO_FLock_setLen (Position x) {
- s_flock.l_len = x;
+void Posix_IO_FLock_setLen (C_Off_t x) {
+ s_flock.l_len = x;
}
-void Posix_IO_FLock_setPid (Int x) {
- s_flock.l_pid = x;
+void Posix_IO_FLock_setPId (C_PId_t x) {
+ s_flock.l_pid = x;
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/close.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/close.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/close.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_IO_close (Fd f) {
- return close (f);
+C_Errno_t(C_Int_t) Posix_IO_close (C_Fd_t f) {
+ return close (f);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/dup.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/dup.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/dup.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Fd Posix_IO_dup (Fd f) {
- return dup( f);
+C_Errno_t(C_Fd_t) Posix_IO_dup (C_Fd_t f) {
+ return dup (f);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/dup2.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/dup2.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/dup2.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Fd Posix_IO_dup2 (Fd f1, Fd f2) {
- return dup2 (f1, f2);
+C_Errno_t(C_Fd_t) Posix_IO_dup2 (C_Fd_t f1, C_Fd_t f2) {
+ return dup2 (f1, f2);
}
Added: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fcntl-consts.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fcntl-consts.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fcntl-consts.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -0,0 +1,13 @@
+#include "platform.h"
+
+const C_Int_t Posix_IO_F_DUPFD = F_DUPFD;
+const C_Int_t Posix_IO_F_GETFD = F_GETFD;
+const C_Int_t Posix_IO_F_SETFD = F_SETFD;
+const C_Int_t Posix_IO_F_GETFL = F_GETFL;
+const C_Int_t Posix_IO_F_SETFL = F_SETFL;
+const C_Int_t Posix_IO_F_GETOWN = F_GETOWN;
+const C_Int_t Posix_IO_F_SETOWN = F_SETOWN;
+
+const C_Fd_t Posix_IO_FD_CLOEXEC = FD_CLOEXEC;
+
+const C_Int_t Posix_IO_O_ACCMODE = O_ACCMODE;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fcntl2.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fcntl2.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fcntl2.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_IO_fcntl2 (Fd f, Int i) {
- return fcntl (f, i);
+C_Errno_t(C_Int_t) Posix_IO_fcntl2 (C_Fd_t f, C_Int_t i) {
+ return fcntl (f, i);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fcntl3.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fcntl3.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fcntl3.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_IO_fcntl3 (Fd f, Int i, Int j) {
- return fcntl (f, i, j);
+C_Errno_t(C_Int_t) Posix_IO_fcntl3 (C_Fd_t f, C_Int_t i, C_Int_t j) {
+ return fcntl (f, i, j);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fsync.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fsync.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fsync.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_IO_fsync (Fd f) {
- return fsync (f);
+C_Errno_t(C_Int_t) Posix_IO_fsync (C_Fd_t f) {
+ return fsync (f);
}
Added: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/lseek-consts.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/lseek-consts.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/lseek-consts.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -0,0 +1,5 @@
+#include "platform.h"
+
+const C_Int_t Posix_IO_SEEK_CUR = SEEK_CUR;
+const C_Int_t Posix_IO_SEEK_END = SEEK_END;
+const C_Int_t Posix_IO_SEEK_SET = SEEK_SET;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/lseek.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/lseek.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/lseek.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Position Posix_IO_lseek (Fd f, Position i, Int j) {
- return lseek (f, i, j);
+C_Errno_t(C_Off_t) Posix_IO_lseek (C_Fd_t f, C_Off_t i, C_Int_t j) {
+ return lseek (f, i, j);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/pipe.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/pipe.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/pipe.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_IO_pipe (Pointer fds) {
- return pipe ((int *) fds);
+C_Errno_t(C_Int_t) Posix_IO_pipe (Vector(C_Fd_t) fds) {
+ return pipe ((int *) fds);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/read.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/read.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/read.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,18 @@
#include "platform.h"
-Ssize Posix_IO_read (Fd fd, Pointer b, Int i, Size s) {
- return (Ssize)(read (fd, (void *) ((char *) b + i), s));
+static inline C_Errno_t(C_SSize_t)
+Posix_IO_read (C_Fd_t fd, Pointer b,
+ C_Int_t i, C_Size_t s) {
+ return read (fd, (void *) ((char *) b + i), s);
}
+
+C_Errno_t(C_SSize_t)
+Posix_IO_readChar8 (C_Fd_t fd, Array(Char8) b,
+ C_Int_t i, C_Size_t s) {
+ return Posix_IO_read (fd, (Pointer)b, i, s);
+}
+C_Errno_t(C_SSize_t)
+Posix_IO_readWord8 (C_Fd_t fd, Array(Word8) b,
+ C_Int_t i, C_Size_t s) {
+ return Posix_IO_read (fd, (Pointer)b, i, s);
+}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/write.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/write.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/write.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,15 +1,28 @@
#include "platform.h"
-enum {
- DEBUG_WRITE = FALSE,
-};
+static inline C_Errno_t(C_SSize_t)
+Posix_IO_write (C_Fd_t fd, Pointer b,
+ C_Int_t i, C_Size_t s) {
+ return write (fd, (void *) ((char *) b + i), s);
+}
-Ssize Posix_IO_write (Fd fd, Pointer b, Int i, Size s) {
- Ssize res;
-
- res = (Ssize)(write (fd, (void *) ((char *) b + i), s));
- if (DEBUG_WRITE)
- fprintf (stderr, "%d = Posix_IO_write (%d, "FMTPTR", %d, %d)\n",
- (int)res, (int)fd, (uintptr_t)b, (int)i, (int)s);
- return res;
+C_Errno_t(C_SSize_t)
+Posix_IO_writeChar8Arr (C_Fd_t fd, Array(Char8_t) b,
+ C_Int_t i, C_Size_t s) {
+ return Posix_IO_write (fd, (Pointer)b, i, s);
}
+C_Errno_t(C_SSize_t)
+Posix_IO_writeChar8Vec (C_Fd_t fd, Vector(Char8_t) b,
+ C_Int_t i, C_Size_t s) {
+ return Posix_IO_write (fd, (Pointer)b, i, s);
+}
+C_Errno_t(C_SSize_t)
+Posix_IO_writeWord8Arr (C_Fd_t fd, Array(Word8_t) b,
+ C_Int_t i, C_Size_t s) {
+ return Posix_IO_write (fd, (Pointer)b, i, s);
+}
+C_Errno_t(C_SSize_t)
+Posix_IO_writeWord8Vec (C_Fd_t fd, Vector(Word8_t) b,
+ C_Int_t i, C_Size_t s) {
+ return Posix_IO_write (fd, (Pointer)b, i, s);
+}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/ProcEnv.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/ProcEnv.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/ProcEnv.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,46 +1,50 @@
#include "platform.h"
-Cstring Posix_ProcEnv_ctermid () {
- char *res = ctermid (NULL);
- return (Cstring)res;
+C_String_t Posix_ProcEnv_ctermid () {
+ char *res = ctermid (NULL);
+ return (C_String_t)res;
}
-Gid Posix_ProcEnv_getegid () {
- return getegid ();
+C_GId_t Posix_ProcEnv_getegid (void) {
+ return getegid ();
}
-Uid Posix_ProcEnv_geteuid () {
- return geteuid ();
+C_UId_t Posix_ProcEnv_geteuid (void) {
+ return geteuid ();
}
-Gid Posix_ProcEnv_getgid () {
- return getgid ();
+C_GId_t Posix_ProcEnv_getgid (void) {
+ return getgid ();
}
-Pid Posix_ProcEnv_getpid () {
- return getpid ();
+C_PId_t Posix_ProcEnv_getpid (void) {
+ return getpid ();
}
-Pid Posix_ProcEnv_getppid () {
- return getppid ();
+C_PId_t Posix_ProcEnv_getppid (void) {
+ return getppid ();
}
-Uid Posix_ProcEnv_getuid () {
- return getuid ();
+C_PId_t Posix_ProcEnv_getpgrp (void) {
+ return getpgrp ();
}
-Int Posix_ProcEnv_setgid (Gid g) {
- return setgid (g);
+C_UId_t Posix_ProcEnv_getuid (void) {
+ return getuid ();
}
-Int Posix_ProcEnv_setpgid (Pid p, Gid g) {
- return setpgid (p, g);
+C_Errno_t(C_Int_t) Posix_ProcEnv_setgid (C_GId_t g) {
+ return setgid (g);
}
-Pid Posix_ProcEnv_setsid () {
- return setsid ();
+C_Errno_t(C_Int_t) Posix_ProcEnv_setpgid (C_PId_t p, C_GId_t g) {
+ return setpgid (p, g);
}
-Int Posix_ProcEnv_setuid (Uid u) {
- return setuid (u);
+C_Errno_t(C_PId_t) Posix_ProcEnv_setsid (void) {
+ return setsid ();
}
+
+C_Errno_t(C_Int_t) Posix_ProcEnv_setuid (C_UId_t u) {
+ return setuid (u);
+}
Copied: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Times.c (from rev 4304, mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Tms.c)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Tms.c 2006-01-24 02:49:37 UTC (rev 4304)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Times.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -0,0 +1,23 @@
+#include "platform.h"
+
+static struct tms tms;
+
+C_Clock_t Posix_ProcEnv_Times_getUTime() {
+ return tms.tms_utime;
+}
+
+C_Clock_t Posix_ProcEnv_Times_getSTime() {
+ return tms.tms_stime;
+}
+
+C_Clock_t Posix_ProcEnv_Times_getCUTime() {
+ return tms.tms_cutime;
+}
+
+C_Clock_t Posix_ProcEnv_Times_getCSTime() {
+ return tms.tms_cstime;
+}
+
+C_Errno_t(C_Clock_t) Posix_ProcEnv_times(void) {
+ return times(&tms);
+}
Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Tms.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Tms.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Tms.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,23 +0,0 @@
-#include "platform.h"
-
-static struct tms tms;
-
-Int Posix_ProcEnv_Tms_utime() {
- return tms.tms_utime;
-}
-
-Int Posix_ProcEnv_Tms_stime() {
- return tms.tms_stime;
-}
-
-Int Posix_ProcEnv_Tms_cutime() {
- return tms.tms_cutime;
-}
-
-Int Posix_ProcEnv_Tms_cstime() {
- return tms.tms_cstime;
-}
-
-Int Posix_ProcEnv_times() {
- return times(&tms);
-}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Uname.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Uname.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Uname.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,37 +1,27 @@
#include "platform.h"
-#ifndef DEBUG
-#define DEBUG FALSE
-#endif
-
static struct utsname utsname;
-Int Posix_ProcEnv_Uname_uname () {
- Int res;
-
- res = uname (&utsname);
- if (DEBUG)
- fprintf (stderr, "%d = Posix_ProcEnv_Uname_uname ()\n",
- (int)res);
- return res;
+C_String_t Posix_ProcEnv_Uname_getSysName () {
+ return (C_String_t)utsname.sysname;
}
-Cstring Posix_ProcEnv_Uname_sysname () {
- return (Cstring)utsname.sysname;
+C_String_t Posix_ProcEnv_Uname_getNodeName () {
+ return (C_String_t)utsname.nodename;
}
-Cstring Posix_ProcEnv_Uname_nodename () {
- return (Cstring)utsname.nodename;
+C_String_t Posix_ProcEnv_Uname_getRelease () {
+ return (C_String_t)utsname.release;
}
-Cstring Posix_ProcEnv_Uname_release () {
- return (Cstring)utsname.release;
+C_String_t Posix_ProcEnv_Uname_getVersion () {
+ return (C_String_t)utsname.version;
}
-Cstring Posix_ProcEnv_Uname_version () {
- return (Cstring)utsname.version;
+C_String_t Posix_ProcEnv_Uname_getMachine () {
+ return (C_String_t)utsname.machine;
}
-Cstring Posix_ProcEnv_Uname_machine () {
- return (Cstring)utsname.machine;
+C_Errno_t(C_Int_t) Posix_ProcEnv_uname () {
+ return uname (&utsname);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/environ.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/environ.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/environ.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,4 @@
#include "platform.h"
/* Manual initialization is a work-around for a Darwin linker issue. */
-CstringArray Posix_ProcEnv_environ = 0;
-
+C_StringArray_t Posix_ProcEnv_environ = (C_StringArray_t)NULL;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getenv.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getenv.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getenv.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,6 +1,6 @@
#include "platform.h"
-Cstring Posix_ProcEnv_getenv(Pointer s) {
- char *res = getenv((char *)s);
- return (Cstring)res;
+C_String_t Posix_ProcEnv_getenv (NullString8_t s) {
+ char *res = getenv((const char*)s);
+ return (C_String_t)res;
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getgroups.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getgroups.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getgroups.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,20 +1,5 @@
#include "platform.h"
-/* It's easier to let the basis library deal with an array of known-size
- * words than to deal with a gid_t size that varies from platform to platform.
- * So, this code copies the array of gid_t's to the array of words passed by the
- * basis.
- */
-
-Int Posix_ProcEnv_getgroups (Pointer groups) {
- int i;
- int result;
- gid_t groupList[Posix_ProcEnv_numgroups];
-
- result = getgroups (Posix_ProcEnv_numgroups, groupList);
-
- for (i = 0; i < result; i++)
- ((Word *) groups)[i] = groupList[i];
-
- return result;
+C_Errno_t(C_Int_t) Posix_ProcEnv_getgroups (C_Int_t i, Array(C_GId_t) a) {
+ return getgroups (i, (gid_t*)a);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getlogin.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getlogin.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getlogin.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,6 +1,6 @@
#include "platform.h"
-Cstring Posix_ProcEnv_getlogin () {
- char *res = getlogin ();
- return (Cstring)(res);
+C_Errno_t(C_String_t) Posix_ProcEnv_getlogin (void) {
+ char *res = getlogin ();
+ return (C_Errno_t(C_String_t))res;
}
Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getpgrp.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getpgrp.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getpgrp.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +0,0 @@
-#include "platform.h"
-
-Pid Posix_ProcEnv_getpgrp () {
- return getpgrp ();
-}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/isatty.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/isatty.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/isatty.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Bool Posix_ProcEnv_isatty (Fd f) {
- return isatty (f);
+Bool_t Posix_ProcEnv_isatty (C_Fd_t f) {
+ return isatty (f);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setenv.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setenv.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setenv.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_ProcEnv_setenv (Pointer s, Pointer v) {
- return setenv ((char*)s, (char*)v, 1);
+C_Errno_t(C_Int_t) Posix_ProcEnv_setenv (NullString8_t s, NullString8_t v) {
+ return setenv ((const char*)s, (const char*)v, 1);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setgroups.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setgroups.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setgroups.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,16 +1,5 @@
#include "platform.h"
-Int Posix_ProcEnv_setgroups (Pointer groups) {
- unsigned int i;
- gid_t *list;
- int res;
- uintmax_t size;
-
- size = GC_getArrayLength (groups);
- list = (gid_t*)(calloc_safe (size, sizeof(*list)));
- for (i = 0; i < size; ++i)
- list[i] = ((Word*)groups)[i];
- res = setgroups (size, list);
- free (list);
- return res;
+C_Errno_t(C_Int_t) Posix_ProcEnv_setgroups (C_Int_t i, Vector(C_GId_t) v) {
+ return setgroups (i, (gid_t*)v);
}
Added: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/sysconf-consts.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/sysconf-consts.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/sysconf-consts.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -0,0 +1,143 @@
+#include "platform.h"
+
+const C_Int_t Posix_ProcEnv_SC_AIO_LISTIO_MAX = _SC_AIO_LISTIO_MAX;
+const C_Int_t Posix_ProcEnv_SC_AIO_MAX = _SC_AIO_MAX;
+const C_Int_t Posix_ProcEnv_SC_AIO_PRIO_DELTA_MAX = _SC_AIO_PRIO_DELTA_MAX;
+const C_Int_t Posix_ProcEnv_SC_ARG_MAX = _SC_ARG_MAX;
+const C_Int_t Posix_ProcEnv_SC_ATEXIT_MAX = _SC_ATEXIT_MAX;
+const C_Int_t Posix_ProcEnv_SC_BC_BASE_MAX = _SC_BC_BASE_MAX;
+const C_Int_t Posix_ProcEnv_SC_BC_DIM_MAX = _SC_BC_DIM_MAX;
+const C_Int_t Posix_ProcEnv_SC_BC_SCALE_MAX = _SC_BC_SCALE_MAX;
+const C_Int_t Posix_ProcEnv_SC_BC_STRING_MAX = _SC_BC_STRING_MAX;
+const C_Int_t Posix_ProcEnv_SC_CHILD_MAX = _SC_CHILD_MAX;
+const C_Int_t Posix_ProcEnv_SC_CLK_TCK = _SC_CLK_TCK;
+const C_Int_t Posix_ProcEnv_SC_COLL_WEIGHTS_MAX = _SC_COLL_WEIGHTS_MAX;
+const C_Int_t Posix_ProcEnv_SC_DELAYTIMER_MAX = _SC_DELAYTIMER_MAX;
+const C_Int_t Posix_ProcEnv_SC_EXPR_NEST_MAX = _SC_EXPR_NEST_MAX;
+const C_Int_t Posix_ProcEnv_SC_HOST_NAME_MAX = _SC_HOST_NAME_MAX;
+const C_Int_t Posix_ProcEnv_SC_IOV_MAX = _SC_IOV_MAX;
+const C_Int_t Posix_ProcEnv_SC_LINE_MAX = _SC_LINE_MAX;
+const C_Int_t Posix_ProcEnv_SC_LOGIN_NAME_MAX = _SC_LOGIN_NAME_MAX;
+const C_Int_t Posix_ProcEnv_SC_NGROUPS_MAX = _SC_NGROUPS_MAX;
+const C_Int_t Posix_ProcEnv_SC_GETGR_R_SIZE_MAX = _SC_GETGR_R_SIZE_MAX;
+const C_Int_t Posix_ProcEnv_SC_GETPW_R_SIZE_MAX = _SC_GETPW_R_SIZE_MAX;
+const C_Int_t Posix_ProcEnv_SC_MQ_OPEN_MAX = _SC_MQ_OPEN_MAX;
+const C_Int_t Posix_ProcEnv_SC_MQ_PRIO_MAX = _SC_MQ_PRIO_MAX;
+const C_Int_t Posix_ProcEnv_SC_OPEN_MAX = _SC_OPEN_MAX;
+const C_Int_t Posix_ProcEnv_SC_ADVISORY_INFO = _SC_ADVISORY_INFO;
+const C_Int_t Posix_ProcEnv_SC_BARRIERS = _SC_BARRIERS;
+const C_Int_t Posix_ProcEnv_SC_ASYNCHRONOUS_IO = _SC_ASYNCHRONOUS_IO;
+const C_Int_t Posix_ProcEnv_SC_CLOCK_SELECTION = _SC_CLOCK_SELECTION;
+const C_Int_t Posix_ProcEnv_SC_CPUTIME = _SC_CPUTIME;
+const C_Int_t Posix_ProcEnv_SC_FSYNC = _SC_FSYNC;
+const C_Int_t Posix_ProcEnv_SC_IPV6 = _SC_IPV6;
+const C_Int_t Posix_ProcEnv_SC_JOB_CONTROL = _SC_JOB_CONTROL;
+const C_Int_t Posix_ProcEnv_SC_MAPPED_FILES = _SC_MAPPED_FILES;
+const C_Int_t Posix_ProcEnv_SC_MEMLOCK = _SC_MEMLOCK;
+const C_Int_t Posix_ProcEnv_SC_MEMLOCK_RANGE = _SC_MEMLOCK_RANGE;
+const C_Int_t Posix_ProcEnv_SC_MEMORY_PROTECTION = _SC_MEMORY_PROTECTION;
+const C_Int_t Posix_ProcEnv_SC_MESSAGE_PASSING = _SC_MESSAGE_PASSING;
+const C_Int_t Posix_ProcEnv_SC_MONOTONIC_CLOCK = _SC_MONOTONIC_CLOCK;
+const C_Int_t Posix_ProcEnv_SC_PRIORITIZED_IO = _SC_PRIORITIZED_IO;
+const C_Int_t Posix_ProcEnv_SC_PRIORITY_SCHEDULING = _SC_PRIORITY_SCHEDULING;
+const C_Int_t Posix_ProcEnv_SC_RAW_SOCKETS = _SC_RAW_SOCKETS;
+const C_Int_t Posix_ProcEnv_SC_READER_WRITER_LOCKS = _SC_READER_WRITER_LOCKS;
+const C_Int_t Posix_ProcEnv_SC_REALTIME_SIGNALS = _SC_REALTIME_SIGNALS;
+const C_Int_t Posix_ProcEnv_SC_REGEXP = _SC_REGEXP;
+const C_Int_t Posix_ProcEnv_SC_SAVED_IDS = _SC_SAVED_IDS;
+const C_Int_t Posix_ProcEnv_SC_SEMAPHORES = _SC_SEMAPHORES;
+const C_Int_t Posix_ProcEnv_SC_SHARED_MEMORY_OBJECTS = _SC_SHARED_MEMORY_OBJECTS;
+const C_Int_t Posix_ProcEnv_SC_SHELL = _SC_SHELL;
+const C_Int_t Posix_ProcEnv_SC_SPAWN = _SC_SPAWN;
+const C_Int_t Posix_ProcEnv_SC_SPIN_LOCKS = _SC_SPIN_LOCKS;
+const C_Int_t Posix_ProcEnv_SC_SPORADIC_SERVER = _SC_SPORADIC_SERVER;
+#ifndef _SC_SS_REPL_MAX
+#define _SC_SS_REPL_MAX -1
+#endif
+const C_Int_t Posix_ProcEnv_SC_SS_REPL_MAX = _SC_SS_REPL_MAX;
+const C_Int_t Posix_ProcEnv_SC_SYNCHRONIZED_IO = _SC_SYNCHRONIZED_IO;
+const C_Int_t Posix_ProcEnv_SC_THREAD_ATTR_STACKADDR = _SC_THREAD_ATTR_STACKADDR;
+const C_Int_t Posix_ProcEnv_SC_THREAD_ATTR_STACKSIZE = _SC_THREAD_ATTR_STACKSIZE;
+const C_Int_t Posix_ProcEnv_SC_THREAD_CPUTIME = _SC_THREAD_CPUTIME;
+const C_Int_t Posix_ProcEnv_SC_THREAD_PRIO_INHERIT = _SC_THREAD_PRIO_INHERIT;
+const C_Int_t Posix_ProcEnv_SC_THREAD_PRIO_PROTECT = _SC_THREAD_PRIO_PROTECT;
+const C_Int_t Posix_ProcEnv_SC_THREAD_PRIORITY_SCHEDULING = _SC_THREAD_PRIORITY_SCHEDULING;
+const C_Int_t Posix_ProcEnv_SC_THREAD_PROCESS_SHARED = _SC_THREAD_PROCESS_SHARED;
+const C_Int_t Posix_ProcEnv_SC_THREAD_SAFE_FUNCTIONS = _SC_THREAD_SAFE_FUNCTIONS;
+const C_Int_t Posix_ProcEnv_SC_THREAD_SPORADIC_SERVER = _SC_THREAD_SPORADIC_SERVER;
+const C_Int_t Posix_ProcEnv_SC_THREADS = _SC_THREADS;
+const C_Int_t Posix_ProcEnv_SC_TIMEOUTS = _SC_TIMEOUTS;
+const C_Int_t Posix_ProcEnv_SC_TIMERS = _SC_TIMERS;
+const C_Int_t Posix_ProcEnv_SC_TRACE = _SC_TRACE;
+const C_Int_t Posix_ProcEnv_SC_TRACE_EVENT_FILTER = _SC_TRACE_EVENT_FILTER;
+#ifndef _SC_TRACE_EVENT_NAME_MAX
+#define _SC_TRACE_EVENT_NAME_MAX -1
+#endif
+const C_Int_t Posix_ProcEnv_SC_TRACE_EVENT_NAME_MAX = _SC_TRACE_EVENT_NAME_MAX;
+const C_Int_t Posix_ProcEnv_SC_TRACE_INHERIT = _SC_TRACE_INHERIT;
+const C_Int_t Posix_ProcEnv_SC_TRACE_LOG = _SC_TRACE_LOG;
+#ifndef _SC_TRACE_NAME_MAX
+#define _SC_TRACE_NAME_MAX -1
+#endif
+const C_Int_t Posix_ProcEnv_SC_TRACE_NAME_MAX = _SC_TRACE_NAME_MAX;
+#ifndef _SC_TRACE_SYS_MAX
+#define _SC_TRACE_SYS_MAX -1
+#endif
+const C_Int_t Posix_ProcEnv_SC_TRACE_SYS_MAX = _SC_TRACE_SYS_MAX;
+#ifndef _SC_TRACE_USER_EVENT_MAX
+#define _SC_TRACE_USER_EVENT_MAX -1
+#endif
+const C_Int_t Posix_ProcEnv_SC_TRACE_USER_EVENT_MAX = _SC_TRACE_USER_EVENT_MAX;
+const C_Int_t Posix_ProcEnv_SC_TYPED_MEMORY_OBJECTS = _SC_TYPED_MEMORY_OBJECTS;
+const C_Int_t Posix_ProcEnv_SC_VERSION = _SC_VERSION;
+const C_Int_t Posix_ProcEnv_SC_V6_ILP32_OFF32 = _SC_V6_ILP32_OFF32;
+const C_Int_t Posix_ProcEnv_SC_V6_ILP32_OFFBIG = _SC_V6_ILP32_OFFBIG;
+const C_Int_t Posix_ProcEnv_SC_V6_LP64_OFF64 = _SC_V6_LP64_OFF64;
+const C_Int_t Posix_ProcEnv_SC_V6_LPBIG_OFFBIG = _SC_V6_LPBIG_OFFBIG;
+const C_Int_t Posix_ProcEnv_SC_2_C_BIND = _SC_2_C_BIND;
+const C_Int_t Posix_ProcEnv_SC_2_C_DEV = _SC_2_C_DEV;
+const C_Int_t Posix_ProcEnv_SC_2_CHAR_TERM = _SC_2_CHAR_TERM;
+const C_Int_t Posix_ProcEnv_SC_2_FORT_DEV = _SC_2_FORT_DEV;
+const C_Int_t Posix_ProcEnv_SC_2_FORT_RUN = _SC_2_FORT_RUN;
+const C_Int_t Posix_ProcEnv_SC_2_LOCALEDEF = _SC_2_LOCALEDEF;
+const C_Int_t Posix_ProcEnv_SC_2_PBS = _SC_2_PBS;
+const C_Int_t Posix_ProcEnv_SC_2_PBS_ACCOUNTING = _SC_2_PBS_ACCOUNTING;
+const C_Int_t Posix_ProcEnv_SC_2_PBS_CHECKPOINT = _SC_2_PBS_CHECKPOINT;
+const C_Int_t Posix_ProcEnv_SC_2_PBS_LOCATE = _SC_2_PBS_LOCATE;
+const C_Int_t Posix_ProcEnv_SC_2_PBS_MESSAGE = _SC_2_PBS_MESSAGE;
+const C_Int_t Posix_ProcEnv_SC_2_PBS_TRACK = _SC_2_PBS_TRACK;
+const C_Int_t Posix_ProcEnv_SC_2_SW_DEV = _SC_2_SW_DEV;
+const C_Int_t Posix_ProcEnv_SC_2_UPE = _SC_2_UPE;
+const C_Int_t Posix_ProcEnv_SC_2_VERSION = _SC_2_VERSION;
+const C_Int_t Posix_ProcEnv_SC_PAGE_SIZE = _SC_PAGE_SIZE;
+const C_Int_t Posix_ProcEnv_SC_PAGESIZE = _SC_PAGESIZE;
+const C_Int_t Posix_ProcEnv_SC_THREAD_DESTRUCTOR_ITERATIONS = _SC_THREAD_DESTRUCTOR_ITERATIONS;
+const C_Int_t Posix_ProcEnv_SC_THREAD_KEYS_MAX = _SC_THREAD_KEYS_MAX;
+const C_Int_t Posix_ProcEnv_SC_THREAD_STACK_MIN = _SC_THREAD_STACK_MIN;
+const C_Int_t Posix_ProcEnv_SC_THREAD_THREADS_MAX = _SC_THREAD_THREADS_MAX;
+const C_Int_t Posix_ProcEnv_SC_RE_DUP_MAX = _SC_RE_DUP_MAX;
+const C_Int_t Posix_ProcEnv_SC_RTSIG_MAX = _SC_RTSIG_MAX;
+const C_Int_t Posix_ProcEnv_SC_SEM_NSEMS_MAX = _SC_SEM_NSEMS_MAX;
+const C_Int_t Posix_ProcEnv_SC_SEM_VALUE_MAX = _SC_SEM_VALUE_MAX;
+const C_Int_t Posix_ProcEnv_SC_SIGQUEUE_MAX = _SC_SIGQUEUE_MAX;
+const C_Int_t Posix_ProcEnv_SC_STREAM_MAX = _SC_STREAM_MAX;
+const C_Int_t Posix_ProcEnv_SC_SYMLOOP_MAX = _SC_SYMLOOP_MAX;
+const C_Int_t Posix_ProcEnv_SC_TIMER_MAX = _SC_TIMER_MAX;
+const C_Int_t Posix_ProcEnv_SC_TTY_NAME_MAX = _SC_TTY_NAME_MAX;
+const C_Int_t Posix_ProcEnv_SC_TZNAME_MAX = _SC_TZNAME_MAX;
+const C_Int_t Posix_ProcEnv_SC_XBS5_ILP32_OFF32 = _SC_XBS5_ILP32_OFF32;
+const C_Int_t Posix_ProcEnv_SC_XBS5_ILP32_OFFBIG = _SC_XBS5_ILP32_OFFBIG;
+const C_Int_t Posix_ProcEnv_SC_XBS5_LP64_OFF64 = _SC_XBS5_LP64_OFF64;
+const C_Int_t Posix_ProcEnv_SC_XBS5_LPBIG_OFFBIG = _SC_XBS5_LPBIG_OFFBIG;
+const C_Int_t Posix_ProcEnv_SC_XOPEN_CRYPT = _SC_XOPEN_CRYPT;
+const C_Int_t Posix_ProcEnv_SC_XOPEN_ENH_I18N = _SC_XOPEN_ENH_I18N;
+const C_Int_t Posix_ProcEnv_SC_XOPEN_LEGACY = _SC_XOPEN_LEGACY;
+const C_Int_t Posix_ProcEnv_SC_XOPEN_REALTIME = _SC_XOPEN_REALTIME;
+const C_Int_t Posix_ProcEnv_SC_XOPEN_REALTIME_THREADS = _SC_XOPEN_REALTIME_THREADS;
+const C_Int_t Posix_ProcEnv_SC_XOPEN_SHM = _SC_XOPEN_SHM;
+#ifndef __SC_XOPEN_STREAMS
+#define _SC_XOPEN_STREAMS -1
+#endif
+const C_Int_t Posix_ProcEnv_SC_XOPEN_STREAMS = _SC_XOPEN_STREAMS;
+const C_Int_t Posix_ProcEnv_SC_XOPEN_UNIX = _SC_XOPEN_UNIX;
+const C_Int_t Posix_ProcEnv_SC_XOPEN_VERSION = _SC_XOPEN_VERSION;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/sysconf.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/sysconf.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/sysconf.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_ProcEnv_sysconf (Int i) {
- return sysconf (i);
+C_Errno_t(C_Long_t) Posix_ProcEnv_sysconf (C_Int_t i) {
+ return sysconf (i);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/ttyname.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/ttyname.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/ttyname.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,6 +1,6 @@
#include "platform.h"
-Cstring Posix_ProcEnv_ttyname (Fd f) {
- char *res = ttyname (f);
- return (Cstring)res;
+C_Errno_t(C_String_t) Posix_ProcEnv_ttyname (C_Fd_t f) {
+ char *res = ttyname (f);
+ return (C_Errno_t(C_String_t))res;
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/alarm.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/alarm.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/alarm.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_Process_alarm (Int i) {
- return alarm (i);
+C_UInt_t Posix_Process_alarm (C_UInt_t i) {
+ return alarm (i);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/exece.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/exece.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/exece.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,27 +1,29 @@
#include "platform.h"
-Int Posix_Process_exece (Pointer p, Pointer a, Pointer e) {
- char *path;
- char *asaved;
- char *esaved;
- char **args;
- char **env;
- int an;
- int en;
- int result;
+C_Errno_t(C_Int_t) Posix_Process_exece (NullString8_t p, NullString8Array_t a, NullString8Array_t e) {
+ const char *path;
+ char *asaved;
+ char *esaved;
+ char **args;
+ char **env;
+ int an;
+ int en;
+ int res;
- path = (char *) p;
- args = (char **) a;
- env = (char **) e;
- an = GC_getArrayLength (a) - 1;
- asaved = args[an];
- en = GC_getArrayLength (e) - 1;
- esaved = env[en];
- args[an] = (char *) NULL;
- env[en] = (char *) NULL;
- result = EXECVE (path, args, env);
- /* exece failed */
- args[an] = asaved;
- env[en] = esaved;
- return result;
+ path = (const char *) p;
+ args = (char **) a;
+ env = (char **) e;
+ an = GC_getArrayLength ((pointer)a) - 1;
+ asaved = args[an];
+ en = GC_getArrayLength ((pointer)e) - 1;
+ esaved = env[en];
+ args[an] = (char *) NULL;
+ env[en] = (char *) NULL;
+ res = EXECVE (path,
+ (char * const *)args,
+ (char * const *)env);
+ /* exece failed */
+ args[an] = asaved;
+ env[en] = esaved;
+ return (C_Errno_t(C_Int_t))res;
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/execp.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/execp.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/execp.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,19 +1,20 @@
#include "platform.h"
-Int Posix_Process_execp (Pointer f, Pointer a) {
- char *file;
- char *saved;
- char **args;
- int n;
- int result;
-
- file = (char *) f;
- args = (char **) a;
- n = GC_getArrayLength (a) - 1;
- saved = args[n];
- args[n] = (char *) NULL;
- result = EXECVP (file, args);
- /* execp failed */
- args[n] = saved;
- return result;
+C_Errno_t(C_Int_t) Posix_Process_execp (NullString8_t f, NullString8Array_t a) {
+ const char *file;
+ char *asaved;
+ char **args;
+ int an;
+ int res;
+
+ file = (const char *) f;
+ args = (char **) a;
+ an = GC_getArrayLength ((pointer)a) - 1;
+ asaved = args[an];
+ args[an] = (char *) NULL;
+ res = EXECVP (file,
+ (char * const *)args);
+ /* execp failed */
+ args[an] = asaved;
+ return (C_Errno_t(C_Int_t))res;
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/exit.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/exit.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/exit.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-void Posix_Process_exit (Int i) {
- exit (i);
+void Posix_Process_exit (C_Status_t i) {
+ exit (i);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/exitStatus.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/exitStatus.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/exitStatus.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,8 +1,8 @@
#include "platform.h"
-Int Posix_Process_exitStatus (Status s) {
- int i;
-
- i = s;
- return WEXITSTATUS (i);
+C_Int_t Posix_Process_exitStatus (C_Status_t s) {
+ int i;
+
+ i = s;
+ return WEXITSTATUS (i);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/fork.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/fork.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/fork.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Pid Posix_Process_fork () {
- return fork ();
+C_Errno_t(C_PId_t) Posix_Process_fork (void) {
+ return fork ();
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/ifExited.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/ifExited.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/ifExited.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,8 +1,8 @@
#include "platform.h"
-Bool Posix_Process_ifExited (Status s) {
- int i;
-
- i = s;
- return WIFEXITED (i);
+Bool Posix_Process_ifExited (C_Status_t s) {
+ int i;
+
+ i = s;
+ return WIFEXITED (i);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/ifSignaled.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/ifSignaled.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/ifSignaled.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,8 +1,8 @@
#include "platform.h"
-Bool Posix_Process_ifSignaled (Status s) {
- int i;
-
- i = s;
- return WIFSIGNALED (i);
+Bool Posix_Process_ifSignaled (C_Status_t s) {
+ int i;
+
+ i = s;
+ return WIFSIGNALED (i);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/ifStopped.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/ifStopped.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/ifStopped.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,8 +1,8 @@
#include "platform.h"
-Bool Posix_Process_ifStopped (Status s) {
- int i;
-
- i = s;
- return WIFSTOPPED (i);
+Bool Posix_Process_ifStopped (C_Status_t s) {
+ int i;
+
+ i = s;
+ return WIFSTOPPED (i);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/kill.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/kill.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/kill.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_Process_kill (Pid p, Signal s) {
- return kill (p, s);
+C_Errno_t(C_Int_t) Posix_Process_kill (C_PId_t p, C_Signal_t s) {
+ return kill (p, s);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/nanosleep.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/nanosleep.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/nanosleep.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,19 +1,16 @@
#include "platform.h"
-Int Posix_Process_nanosleep (Pointer sec, Pointer nsec) {
- struct timespec rem;
- struct timespec req;
- int res;
-
- req.tv_sec = *(Int*)sec;
- req.tv_nsec =*(Int*)nsec;
- rem.tv_sec = 0;
- rem.tv_nsec = 0;
- res = nanosleep (&req, &rem);
- if (FALSE)
- fprintf (stderr, "res = %d sec = %d nsec = %d\n",
- res, (int)rem.tv_sec, (int)rem.tv_nsec);
- *(Int*)sec = rem.tv_sec;
- *(Int*)nsec = rem.tv_nsec;
- return res;
+C_Errno_t(C_Int_t) Posix_Process_nanosleep (Ref(C_Time_t) sec, Ref(C_Long_t) nsec) {
+ struct timespec rem;
+ struct timespec req;
+ int res;
+
+ req.tv_sec = *((time_t*)sec);
+ req.tv_nsec =*((long*)nsec);
+ rem.tv_sec = 0;
+ rem.tv_nsec = 0;
+ res = nanosleep (&req, &rem);
+ *((time_t*)sec) = rem.tv_sec;
+ *((long*)nsec) = rem.tv_nsec;
+ return res;
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/pause.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/pause.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/pause.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_Process_pause () {
- return pause ();
+C_Errno_t(C_Int_t) Posix_Process_pause (void) {
+ return pause ();
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/sleep.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/sleep.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/sleep.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_Process_sleep (Int i) {
- return sleep (i);
+C_UInt_t Posix_Process_sleep (C_UInt_t i) {
+ return sleep (i);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/stopSig.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/stopSig.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/stopSig.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,8 +1,8 @@
#include "platform.h"
-Signal Posix_Process_stopSig (Status s) {
- int i;
-
- i = s;
- return WSTOPSIG (i);
+C_Signal_t Posix_Process_stopSig (C_Status_t s) {
+ int i;
+
+ i = s;
+ return WSTOPSIG (i);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/system.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/system.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/system.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-int Posix_Process_system (const char* cmd) {
- return system (cmd);
+C_Errno_t(C_Status_t) Posix_Process_system (NullString8_t cmd) {
+ return system ((const char*) cmd);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/termSig.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/termSig.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/termSig.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,8 +1,8 @@
#include "platform.h"
-Signal Posix_Process_termSig (Status s) {
- int i;
-
- i = s;
- return WTERMSIG (i);
+C_Signal_t Posix_Process_termSig (C_Status_t s) {
+ int i;
+
+ i = s;
+ return WTERMSIG (i);
}
Added: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/waitpid-consts.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/waitpid-consts.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/waitpid-consts.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -0,0 +1,5 @@
+#include "platform.h"
+
+const C_Int_t Posix_Process_W_CONTINUED = WCONTINUED;
+const C_Int_t Posix_Process_W_NOHANG = WNOHANG;
+const C_Int_t Posix_Process_W_UNTRACED = WUNTRACED;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/waitpid.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/waitpid.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/waitpid.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,5 +1,5 @@
#include "platform.h"
-Pid Posix_Process_waitpid (Pid p, Pointer s, Int i) {
- return waitpid (p, (int*)s, i);
+C_Errno_t(C_PId_t) Posix_Process_waitpid (C_PId_t p, Ref(C_Int_t) s, C_Int_t i) {
+ return waitpid (p, (int*)s, i);
}
Added: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal-consts.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal-consts.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal-consts.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -0,0 +1,42 @@
+#include "platform.h"
+
+#if (defined (NSIG))
+#define Posix_Signal_NSIG NSIG
+#elif (defined (_NSIG))
+#define Posix_Signal_NSIG _NSIG
+#else
+#error Posix_Signal_numSignals not defined
+#endif
+
+const C_Int_t Posix_Signal_SIG_BLOCK = SIG_BLOCK;
+const C_Int_t Posix_Signal_SIG_SETMASK = SIG_SETMASK;
+const C_Int_t Posix_Signal_SIG_UNBLOCK = SIG_UNBLOCK;
+
+const C_Signal_t Posix_Signal_SIGABRT = SIGABRT;
+const C_Signal_t Posix_Signal_SIGALRM = SIGALRM;
+const C_Signal_t Posix_Signal_SIGBUS = SIGBUS;
+const C_Signal_t Posix_Signal_SIGCHLD = SIGCHLD;
+const C_Signal_t Posix_Signal_SIGCONT = SIGCONT;
+const C_Signal_t Posix_Signal_SIGFPE = SIGFPE;
+const C_Signal_t Posix_Signal_SIGHUP = SIGHUP;
+const C_Signal_t Posix_Signal_SIGILL = SIGILL;
+const C_Signal_t Posix_Signal_SIGINT = SIGINT;
+const C_Signal_t Posix_Signal_SIGKILL = SIGKILL;
+const C_Signal_t Posix_Signal_SIGPIPE = SIGPIPE;
+const C_Signal_t Posix_Signal_SIGQUIT = SIGQUIT;
+const C_Signal_t Posix_Signal_SIGSEGV = SIGSEGV;
+const C_Signal_t Posix_Signal_SIGSTOP = SIGSTOP;
+const C_Signal_t Posix_Signal_SIGTERM = SIGTERM;
+const C_Signal_t Posix_Signal_SIGTSTP = SIGTSTP;
+const C_Signal_t Posix_Signal_SIGTTIN = SIGTTIN;
+const C_Signal_t Posix_Signal_SIGTTOU = SIGTTOU;
+const C_Signal_t Posix_Signal_SIGUSR1 = SIGUSR1;
+const C_Signal_t Posix_Signal_SIGUSR2 = SIGUSR2;
+const C_Signal_t Posix_Signal_SIGPOLL = SIGPOLL;
+const C_Signal_t Posix_Signal_SIGPROF = SIGPROF;
+const C_Signal_t Posix_Signal_SIGSYS = SIGSYS;
+const C_Signal_t Posix_Signal_SIGTRAP = SIGTRAP;
+const C_Signal_t Posix_Signal_SIGURG = SIGURG;
+const C_Signal_t Posix_Signal_SIGVTALRM = SIGVTALRM;
+const C_Signal_t Posix_Signal_SIGXCPU = SIGXCPU;
+const C_Signal_t Posix_Signal_SIGXFSZ = SIGXFSZ;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -3,115 +3,117 @@
extern struct GC_state gcState;
static void handler (int signum) {
- GC_handler (&gcState, signum);
+ GC_handler (&gcState, signum);
}
enum {
#if (defined (SA_ONSTACK))
- SA_FLAGS = SA_ONSTACK,
+ SA_FLAGS = SA_ONSTACK,
#else
- SA_FLAGS = 0,
+ SA_FLAGS = 0,
#endif
};
-Int Posix_Signal_default (Int signum) {
- struct sigaction sa;
+C_Errno_t(C_Int_t) Posix_Signal_default (C_Signal_t signum) {
+ struct sigaction sa;
- sigdelset (GC_getSignalsHandledAddr (&gcState), signum);
- memset (&sa, 0, sizeof(sa));
- sa.sa_handler = SIG_DFL;
- sa.sa_flags = SA_FLAGS;
- return sigaction (signum, &sa, NULL);
+ sigdelset (GC_getSignalsHandledAddr (&gcState), signum);
+ memset (&sa, 0, sizeof(sa));
+ sa.sa_handler = SIG_DFL;
+ sa.sa_flags = SA_FLAGS;
+ return sigaction (signum, &sa, NULL);
}
-bool Posix_Signal_isGCPending (void) {
- Bool res;
+C_Errno_t(C_Int_t) Posix_Signal_isDefault (C_Int_t signum, Ref(Bool_t) isDef) {
+ int res;
+ struct sigaction sa;
- res = GC_getGCSignalPending (&gcState);
- if (DEBUG_SIGNALS)
- fprintf (stderr, "%s = Posix_Signal_isGCPending ()\n",
- boolToString (res));
- return res;
+ sa.sa_flags = SA_FLAGS;
+ res = sigaction (signum, NULL, &sa);
+ *((Bool_t*)isDef) = sa.sa_handler == SIG_DFL;
+ return res;
}
-Bool Posix_Signal_isPending (Int signum) {
- return sigismember (GC_getSignalsPendingAddr (&gcState), signum);
+C_Errno_t(C_Int_t) Posix_Signal_ignore (C_Signal_t signum) {
+ struct sigaction sa;
+
+ sigdelset (GC_getSignalsHandledAddr (&gcState), signum);
+ memset (&sa, 0, sizeof(sa));
+ sa.sa_handler = SIG_IGN;
+ sa.sa_flags = SA_FLAGS;
+ return sigaction (signum, &sa, NULL);
}
-Int Posix_Signal_handle (Int signum) {
- static struct sigaction sa;
+C_Errno_t(C_Int_t) Posix_Signal_isIgnore (C_Int_t signum, Ref(Bool_t) isDef) {
+ int res;
+ struct sigaction sa;
- sigaddset (GC_getSignalsHandledAddr (&gcState), signum);
- memset (&sa, 0, sizeof(sa));
- /* The mask must be full because GC_handler reads and writes
- * s->signalsPending (else there is a race condition).
- */
- sigfillset (&sa.sa_mask);
- sa.sa_handler = handler;
- sa.sa_flags = SA_FLAGS;
- return sigaction (signum, &sa, NULL);
+ sa.sa_flags = SA_FLAGS;
+ res = sigaction (signum, NULL, &sa);
+ *((Bool_t*)isDef) = sa.sa_handler == SIG_IGN;
+ return res;
}
+C_Errno_t(C_Int_t) Posix_Signal_handle (C_Int_t signum) {
+ static struct sigaction sa;
+
+ sigaddset (GC_getSignalsHandledAddr (&gcState), signum);
+ memset (&sa, 0, sizeof(sa));
+ /* The mask must be full because GC_handler reads and writes
+ * s->signalsPending (else there is a race condition).
+ */
+ sigfillset (&sa.sa_mask);
+ sa.sa_handler = handler;
+ sa.sa_flags = SA_FLAGS;
+ return sigaction (signum, &sa, NULL);
+}
+
void Posix_Signal_handleGC (void) {
- GC_setGCSignalHandled (&gcState, TRUE);
+ GC_setGCSignalHandled (&gcState, TRUE);
}
-Int Posix_Signal_ignore (Int signum) {
- struct sigaction sa;
-
- sigdelset (GC_getSignalsHandledAddr (&gcState), signum);
- memset (&sa, 0, sizeof(sa));
- sa.sa_handler = SIG_IGN;
- sa.sa_flags = SA_FLAGS;
- return sigaction (signum, &sa, NULL);
+Bool_t Posix_Signal_isPending (C_Int_t signum) {
+ return sigismember (GC_getSignalsPendingAddr (&gcState), signum);
}
-Int Posix_Signal_isDefault (Int signum, Bool *isDef) {
- Int res;
- struct sigaction sa;
-
- sa.sa_flags = SA_FLAGS;
- res = sigaction (signum, NULL, &sa);
- *isDef = sa.sa_handler == SIG_DFL;
- return res;
+Bool_t Posix_Signal_isPendingGC (void) {
+ return GC_getGCSignalPending (&gcState);
}
void Posix_Signal_resetPending (void) {
- if (DEBUG_SIGNALS)
- fprintf (stderr, "Posix_Signal_resetPending ()\n");
- sigemptyset (GC_getSignalsPendingAddr (&gcState));
- GC_setGCSignalPending (&gcState, FALSE);
+ sigemptyset (GC_getSignalsPendingAddr (&gcState));
+ GC_setGCSignalPending (&gcState, FALSE);
}
static sigset_t set;
-Int Posix_Signal_sigaddset (Int signum) {
- return sigaddset (&set, signum);
+C_Errno_t(C_Int_t) Posix_Signal_sigaddset (C_Signal_t signum) {
+ return sigaddset (&set, signum);
}
-Int Posix_Signal_sigdelset (Int signum) {
- return sigdelset (&set, signum);
+C_Errno_t(C_Int_t) Posix_Signal_sigdelset (C_Signal_t signum) {
+ return sigdelset (&set, signum);
}
-Int Posix_Signal_sigemptyset (void) {
- return sigemptyset (&set);
+C_Errno_t(C_Int_t) Posix_Signal_sigemptyset (void) {
+ return sigemptyset (&set);
}
-Int Posix_Signal_sigfillset (void) {
- return sigfillset (&set);
+C_Errno_t(C_Int_t) Posix_Signal_sigfillset (void) {
+ return sigfillset (&set);
}
-Int Posix_Signal_sigismember (Int signum) {
- return sigismember (&set, signum);
+C_Errno_t(C_Int_t) Posix_Signal_sigismember (C_Signal_t signum) {
+ return sigismember (&set, signum);
}
-Int Posix_Signal_sigprocmask (Int how) {
- return sigprocmask (how, &set, &set);
+C_Errno_t(C_Int_t) Posix_Signal_sigprocmask (C_Int_t how) {
+ return sigprocmask (how, &set, &set);
}
-void Posix_Signal_suspend (void) {
- int res;
+void Posix_Signal_sigsuspend (void) {
+ int res;
- res = sigsuspend (&set);
- assert (-1 == res);
+ res = sigsuspend (&set);
+ assert (-1 == res);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/SysDB/Group.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/SysDB/Group.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/SysDB/Group.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -2,22 +2,22 @@
static struct group *group;
-Cstring Posix_SysDB_Group_name() {
- return (Cstring)group->gr_name;
+C_String_t Posix_SysDB_Group_getName(void) {
+ return (C_String_t)(group->gr_name);
}
-Gid Posix_SysDB_Group_gid() {
- return group->gr_gid;
+C_GId_t Posix_SysDB_Group_getGId(void) {
+ return group->gr_gid;
}
-CstringArray Posix_SysDB_Group_mem() {
- return (CstringArray)group->gr_mem;
+C_StringArray_t Posix_SysDB_Group_getMem(void) {
+ return (C_StringArray_t)(group->gr_mem);
}
-Bool Posix_SysDB_getgrgid(Gid g) {
- return NULL != (group = getgrgid ((gid_t)g));
+Bool_t Posix_SysDB_getgrgid(C_GId_t g) {
+ return NULL != (group = getgrgid ((gid_t)g));
}
-Bool Posix_SysDB_getgrnam(Pointer s) {
- return NULL != (group = getgrnam ((char*)s));
+Bool_t Posix_SysDB_getgrnam(NullString8_t s) {
+ return NULL != (group = getgrnam ((const char*)s));
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/SysDB/Passwd.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/SysDB/Passwd.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/SysDB/Passwd.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -2,30 +2,30 @@
static struct passwd *passwd;
-Cstring Posix_SysDB_Passwd_name() {
- return (Cstring)passwd->pw_name;
+C_String_t Posix_SysDB_Passwd_getName(void) {
+ return (C_String_t)(passwd->pw_name);
}
-Uid Posix_SysDB_Passwd_uid() {
- return passwd->pw_uid;
+C_UId_t Posix_SysDB_Passwd_getUId(void) {
+ return passwd->pw_uid;
}
-Gid Posix_SysDB_Passwd_gid() {
- return passwd->pw_gid;
+C_GId_t Posix_SysDB_Passwd_getGId(void) {
+ return passwd->pw_gid;
}
-Cstring Posix_SysDB_Passwd_dir() {
- return (Cstring)passwd->pw_dir;
+C_String_t Posix_SysDB_Passwd_getDir(void) {
+ return (C_String_t)(passwd->pw_dir);
}
-Cstring Posix_SysDB_Passwd_shell() {
- return (Cstring)passwd->pw_shell;
+C_String_t Posix_SysDB_Passwd_getShell(void) {
+ return (C_String_t)(passwd->pw_shell);
}
-Bool Posix_SysDB_getpwnam(Pointer p) {
- return NULL != (passwd = getpwnam((char *) p));
+Bool_t Posix_SysDB_getpwnam(NullString8_t p) {
+ return NULL != (passwd = getpwnam((const char *) p));
}
-Bool Posix_SysDB_getpwuid(Uid u) {
- return NULL != (passwd = getpwuid(u));
+Bool_t Posix_SysDB_getpwuid(C_UId_t u) {
+ return NULL != (passwd = getpwuid(u));
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/TODO
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/TODO 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/TODO 2006-01-26 03:06:35 UTC (rev 4307)
@@ -4,82 +4,13 @@
* Use C99 <assert.h> instead of util/assert.{c,h}
-
-Posix/FileSys/Utimbuf.c
-Posix/FileSys/access.c
-Posix/FileSys/chdir.c
-Posix/FileSys/chmod.c
-Posix/FileSys/chown.c
-Posix/FileSys/fchmod.c
-Posix/FileSys/fchown.c
-Posix/FileSys/fpathconf.c
-Posix/FileSys/ftruncate.c
-Posix/FileSys/getcwd.c
-Posix/FileSys/link.c
-Posix/FileSys/mkdir.c
-Posix/FileSys/mkfifo.c
-Posix/FileSys/open.c
-Posix/FileSys/pathconf.c
-Posix/FileSys/readlink.c
-Posix/FileSys/rename.c
-Posix/FileSys/rmdir.c
-Posix/FileSys/symlink.c
-Posix/FileSys/umask.c
-Posix/FileSys/unlink.c
-Posix/IO/FLock.c
-Posix/IO/close.c
-Posix/IO/dup.c
-Posix/IO/dup2.c
-Posix/IO/fcntl2.c
-Posix/IO/fcntl3.c
-Posix/IO/fsync.c
-Posix/IO/lseek.c
-Posix/IO/pipe.c
-Posix/IO/read.c
-Posix/IO/write.c
-Posix/ProcEnv/ProcEnv.c
-Posix/ProcEnv/Tms.c
-Posix/ProcEnv/Uname.c
-Posix/ProcEnv/environ.c
-Posix/ProcEnv/getenv.c
-Posix/ProcEnv/getgroups.c
-Posix/ProcEnv/getlogin.c
-Posix/ProcEnv/getpgrp.c
-Posix/ProcEnv/isatty.c
-Posix/ProcEnv/setenv.c
-Posix/ProcEnv/setgroups.c
-Posix/ProcEnv/sysconf.c
-Posix/ProcEnv/ttyname.c
-Posix/Process/alarm.c
-Posix/Process/exece.c
-Posix/Process/execp.c
-Posix/Process/exit.c
-Posix/Process/exitStatus.c
-Posix/Process/fork.c
-Posix/Process/ifExited.c
-Posix/Process/ifSignaled.c
-Posix/Process/ifStopped.c
-Posix/Process/kill.c
-Posix/Process/nanosleep.c
-Posix/Process/pause.c
-Posix/Process/sleep.c
-Posix/Process/stopSig.c
-Posix/Process/system.c
-Posix/Process/termSig.c
-Posix/Process/waitpid.c
-Posix/Signal.c
-Posix/SysDB/Group.c
-Posix/SysDB/Passwd.c
basis/Int/Word.c
basis/Int/Word8Array.c
basis/Int/Word8Vector.c
basis/IntInf.c
basis/MLton/allocTooLarge.c
basis/MLton/bug.c
-basis/MLton/spawne.c
-basis/MLton/spawnp.c
basis/PackReal.c
-basis/Ptrace.c
basis/Real/Math.c
basis/Real/class.c
basis/Real/frexp.c
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Process/spawne.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Process/spawne.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Process/spawne.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,36 +1,36 @@
#include "platform.h"
#if HAS_SPAWN
-Int MLton_Process_spawne (NullString p, Pointer a, Pointer e) {
- char *path;
- char *asaved;
- char *esaved;
- char **args;
- char **env;
- int an;
- int en;
- int result;
+C_Errno_t(C_Int_t) MLton_Process_spawne (NullString8_t p, NullString8Array_t a, NullString8Array_t e) {
+ const char *path;
+ char *asaved;
+ char *esaved;
+ char **args;
+ char **env;
+ int an;
+ int en;
+ int res;
- path = (char *) p;
- args = (char **) a;
- env = (char **) e;
- an = GC_arrayNumElements(a) - 1;
- asaved = args[an];
- en = GC_arrayNumElements(e) - 1;
- esaved = env[en];
- args[an] = (char *) NULL;
- env[en] = (char *) NULL;
- result = spawnve (SPAWN_MODE, path,
- (const char * const *)args,
- (const char * const *)env);
- args[an] = asaved;
- env[en] = esaved;
- return result;
+ path = (const char *) p;
+ args = (char **) a;
+ env = (char **) e;
+ an = GC_arrayNumElements((pointer)a) - 1;
+ asaved = args[an];
+ en = GC_arrayNumElements((pointer)e) - 1;
+ esaved = env[en];
+ args[an] = (char *) NULL;
+ env[en] = (char *) NULL;
+ res = spawnve (SPAWN_MODE, path,
+ (const char * const *)args,
+ (const char * const *)env);
+ args[an] = asaved;
+ env[en] = esaved;
+ return res;
}
#else
-Int MLton_Process_spawne (__attribute__ ((unused)) Pointer p,
- __attribute__ ((unused)) Pointer a,
- __attribute__ ((unused)) Pointer e) {
- die ("MLton_Process_spawne not implemented");
+C_Errno_t(C_Int_t) MLton_Process_spawne (__attribute__ ((unused)) NullString8_t p,
+ __attribute__ ((unused)) NullString8Array_t a,
+ __attribute__ ((unused)) NullString8Array_t e) {
+ die ("MLton_Process_spawne not implemented");
}
#endif
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Process/spawnp.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Process/spawnp.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Process/spawnp.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,25 +1,26 @@
#include "platform.h"
#if HAS_SPAWN
-Int MLton_Process_spawnp (NullString p, Pointer a) {
- char *path;
- char *asaved;
- char **args;
- int an;
- int result;
+C_Errno_t(C_Int_t) MLton_Process_spawnp (NullString8_t p, NullString8Array_t a) {
+ const char *file;
+ char *asaved;
+ char **args;
+ int an;
+ int res;
- path = (char *) p;
- args = (char **) a;
- an = GC_arrayNumElements(a) - 1;
- asaved = args[an];
- args[an] = (char *) NULL;
- result = spawnvp (SPAWN_MODE, path, (const char * const *)args);
- args[an] = asaved;
- return result;
+ path = (const char *) p;
+ args = (char **) a;
+ an = GC_arrayNumElements((pointer)a) - 1;
+ asaved = args[an];
+ args[an] = (char *) NULL;
+ result = spawnvp (SPAWN_MODE, path,
+ (const char * const *)args);
+ args[an] = asaved;
+ return res;
}
#else
-Int MLton_Process_spawnp (__attribute__ ((unused)) Pointer p,
- __attribute__ ((unused)) Pointer a) {
- die ("MLton_Process_spawnp not implemented");
+C_Errno_t(C_Int_t) MLton_Process_spawnp (__attribute__ ((unused)) NullString8_t p,
+ __attribute__ ((unused)) NullString8Array_t a) {
+ die ("MLton_Process_spawnp not implemented");
}
#endif
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetHostDB.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetHostDB.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetHostDB.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -48,6 +48,6 @@
return (hostent != NULL and hostent->h_name != NULL);
}
-C_Errno_t(C_Int_t) NetHostDB_getHostName(Array(Char8_t) buf, C_Size_t len) {
- return gethostname ((char*)buf, len);
+Bool NetHostDB_getHostName(Array(Char8_t) buf, C_Size_t len) {
+ return (gethostname ((char*)buf, len) == 0);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/INetSock.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/INetSock.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/INetSock.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -22,7 +22,7 @@
in_addr = sa->sin_addr;
}
-Int Socket_INetSock_getPort (void) {
+C_Int_t Socket_INetSock_getPort (void) {
return port;
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/Socket.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/Socket.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/Socket.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -44,15 +44,26 @@
(struct sockaddr*)addr, (socklen_t*)addrlen);
}
-C_Errno_t(C_SSize_t)
-Socket_send (C_Sock_t s, Vector(Word8_t) msg,
+static inline C_Errno_t(C_SSize_t)
+Socket_send (C_Sock_t s, Pointer msg,
C_Int_t start, C_Size_t len, C_Int_t flags) {
MLton_initSockets ();
return send (s, (void*)((char *)msg + start), len, flags);
}
-C_Errno_t(C_SSize_t)
-Socket_sendTo (C_Sock_t s, Vector(Word8_t)msg,
+C_Errno_t(C_SSize_t)
+Socket_sendArr (C_Sock_t s, Array(Word8_t) msg,
+ C_Int_t start, C_Size_t len, C_Int_t flags) {
+ return Socket_send (s, (Pointer)msg, start, len, flags);
+}
+C_Errno_t(C_SSize_t)
+Socket_sendVec (C_Sock_t s, Vector(Word8_t) msg,
+ C_Int_t start, C_Size_t len, C_Int_t flags) {
+ return Socket_send (s, (Pointer)msg, start, len, flags);
+}
+
+static inline C_Errno_t(C_SSize_t)
+Socket_sendTo (C_Sock_t s, Pointer msg,
C_Int_t start, C_Size_t len, C_Int_t flags,
Vector(Word8_t) addr, C_Socklen_t addrlen) {
MLton_initSockets ();
@@ -60,6 +71,19 @@
(struct sockaddr*)addr, (socklen_t)addrlen);
}
+C_Errno_t(C_SSize_t)
+Socket_sendArrTo (C_Sock_t s, Array(Word8_t) msg,
+ C_Int_t start, C_Size_t len, C_Int_t flags,
+ Vector(Word8_t) addr, C_Socklen_t addrlen) {
+ return Socket_sendTo (s, (Pointer)msg, start, len, flags, addr, addrlen);
+}
+C_Errno_t(C_SSize_t)
+Socket_sendVecTo (C_Sock_t s, Vector(Word8_t) msg,
+ C_Int_t start, C_Size_t len, C_Int_t flags,
+ Vector(Word8_t) addr, C_Socklen_t addrlen) {
+ return Socket_sendTo (s, (Pointer)msg, start, len, flags, addr, addrlen);
+}
+
C_Errno_t(C_Int_t) Socket_shutdown (C_Sock_t s, C_Int_t how) {
MLton_initSockets ();
return shutdown (s, how);
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/UnixSock.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/UnixSock.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/UnixSock.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -10,11 +10,11 @@
i = 0;
if (pathlen <= UNIXSOCK_PATH_MAX) {
for (i = 0; i < pathlen; i++) {
- sa->sun_path[i] = path[i];
+ sa->sun_path[i] = ((const char*)path)[i];
}
} else {
for (i = 0; i < UNIXSOCK_PATH_MAX-1; i++) {
- sa->sun_path[i] = path[i];
+ sa->sun_path[i] = ((const char*)path)[i];
}
sa->sun_path[UNIXSOCK_PATH_MAX-1] = '\000';
}
Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Ptrace.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Ptrace.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Ptrace.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,13 +0,0 @@
-#include "platform.h"
-
-#if HAS_PTRACE
-
-Int Ptrace_ptrace2 (Int request, Int pid) {
- return ptrace (request, pid, NULL, NULL);
-}
-
-Int Ptrace_ptrace4 (Int request, Int pid, Word addr, Pointer data) {
- return ptrace (request, pid, (void *) addr, (void *) data);
-}
-
-#endif
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/gdtoa.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/gdtoa.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/gdtoa.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -6,7 +6,7 @@
#endif
/* This code is patterned on g_dfmt from the gdtoa sources. */
-Cstring Real64_gdtoa (double d, int mode, int ndig, int *decpt) {
+C_String_t Real64_gdtoa (double d, int mode, int ndig, int *decpt) {
ULong bits[2];
int ex;
static FPI fpi = { 53, 1-1023-53+1, 2046-1023-53+1, 1, 0 };
@@ -37,10 +37,10 @@
if (DEBUG)
fprintf (stderr, "%s = gdtoa (%g, %d, %d) decpt = %d\n",
result, d, mode, ndig, *decpt);
- return (Cstring)result;
+ return (C_String_t)result;
}
-Cstring Real32_gdtoa (float f, int mode, int ndig, int *decpt) {
+C_String_t Real32_gdtoa (float f, int mode, int ndig, int *decpt) {
ULong bits[1];
int ex;
static FPI fpi = { 24, 1-127-24+1, 254-127-24+1, 1, 0 };
@@ -70,5 +70,5 @@
if (DEBUG)
fprintf (stderr, "%s = gdtoa (%g, %d, %d) decpt = %d\n",
result, (double)f, mode, ndig, *decpt);
- return (Cstring)result;
+ return (C_String_t)result;
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Stdio.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Stdio.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Stdio.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -1,9 +1,9 @@
#include "platform.h"
-void Stdio_print (String_t s) {
- uintmax_t size = GC_getArrayLength (s);
+void Stdio_print (String8_t s) {
+ uintmax_t size = GC_getArrayLength ((pointer)s);
if (0 == size)
return;
- while (1 != fwrite (s, (size_t)size, 1, stderr))
+ while (1 != fwrite ((const void*)s, (size_t)size, 1, stderr))
/* nothing */;
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/Date.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/Date.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/Date.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -58,6 +58,6 @@
return mktime(&tm_in);
}
-C_Size_t Date_strfTime(Array(Char8_t) buf, C_Size_t n, NullString_t fmt) {
+C_Size_t Date_strfTime(Array(Char8_t) buf, C_Size_t n, NullString8_t fmt) {
return strftime((char*)(buf), n, (char*)(fmt), &tm_in);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/OS/IO/poll.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/OS/IO/poll.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/OS/IO/poll.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -11,12 +11,12 @@
struct pollfd ufds[n];
for (i = 0; i < n; i++) {
- ufds[i].fd = fds[i];
- ufds[i].events = eventss[i];
+ ufds[i].fd = ((nfds_t*)fds)[i];
+ ufds[i].events = ((short*)eventss)[i];
}
res = poll (ufds, n, timeout);
for (i = 0; i < n; i++) {
- reventss[i] = ufds[i].revents;
+ ((short*)reventss)[i] = ufds[i].revents;
}
return res;
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h 2006-01-26 03:06:35 UTC (rev 4307)
@@ -12,13 +12,14 @@
/* GNU C Library Feature Macros */
#define _ISOC99_SOURCE
#define _BSD_SOURCE
-#define _XOPEN_SOURCE 600
+// #define _XOPEN_SOURCE 600
/* Only enable _POSIX_C_SOURCE on platforms that don't have broken
* system headers.
*/
#if (defined (__linux__))
#define _POSIX_C_SOURCE 200112L
#endif
+#define _FILE_OFFSET_BITS 64
/* C99 headers */
// #include <assert.h>
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def 2006-01-26 03:06:35 UTC (rev 4307)
@@ -35,6 +35,9 @@
MLton.Itimer.REAL = _const : C.Int.t
MLton.Itimer.VIRTUAL = _const : C.Int.t
MLton.Itimer.set = _import : C.Int.t * C.Time.t * C.SUSeconds.t * C.Time.t * C.SUSeconds.t -> C.Int.t C.Errno.t
+MLton.Process.cwait = _import : C.PId.t * C.Int.t ref -> C.PId.t C.Errno.t
+MLton.Process.spawne = _import : NullString8.t * NullString8Array.t * NullString8Array.t -> C.Int.t C.Errno.t
+MLton.Process.spawnp = _import : NullString8.t * NullString8Array.t -> C.Int.t C.Errno.t
MLton.Rlimit.AS = _const : C.Int.t
MLton.Rlimit.CORE = _const : C.Int.t
MLton.Rlimit.CPU = _const : C.Int.t
@@ -66,7 +69,7 @@
Net.ntohs = _import : Word16.t -> Word16.t
NetHostDB.INADDR_ANY = _const : C.Int.t
NetHostDB.getByAddress = _import : Word8.t vector * C.Socklen.t -> Bool.t
-NetHostDB.getByName = _import : NullString8.t -> C.Int.t C.HErrno.t
+NetHostDB.getByName = _import : NullString8.t -> Bool.t
NetHostDB.getEntryAddrType = _import : unit -> C.Int.t
NetHostDB.getEntryAddrsN = _import : C.Int.t * Word8.t array -> unit
NetHostDB.getEntryAddrsNum = _import : unit -> C.Int.t
@@ -177,6 +180,394 @@
Posix.Error.clearErrno = _import : unit -> unit
Posix.Error.getErrno = _import : unit -> C.Int.t
Posix.Error.strError = _import : C.Int.t -> C.String.t
+Posix.FileSys.A.F_OK = _const : C.Int.t
+Posix.FileSys.A.R_OK = _const : C.Int.t
+Posix.FileSys.A.W_OK = _const : C.Int.t
+Posix.FileSys.A.X_OK = _const : C.Int.t
+Posix.FileSys.Dirstream.closeDir = _import : C.DirP.t -> C.Int.t C.Errno.t
+Posix.FileSys.Dirstream.openDir = _import : NullString8.t -> C.DirP.t C.Errno.t
+Posix.FileSys.Dirstream.readDir = _import : C.DirP.t -> C.String.t C.Errno.t
+Posix.FileSys.Dirstream.rewindDir = _import : C.DirP.t -> unit
+Posix.FileSys.O.APPEND = _const : C.Int.t
+Posix.FileSys.O.BINARY = _const : C.Int.t
+Posix.FileSys.O.CREAT = _const : C.Int.t
+Posix.FileSys.O.DSYNC = _const : C.Int.t
+Posix.FileSys.O.EXCL = _const : C.Int.t
+Posix.FileSys.O.NOCTTY = _const : C.Int.t
+Posix.FileSys.O.NONBLOCK = _const : C.Int.t
+Posix.FileSys.O.RDONLY = _const : C.Int.t
+Posix.FileSys.O.RDWR = _const : C.Int.t
+Posix.FileSys.O.RSYNC = _const : C.Int.t
+Posix.FileSys.O.SYNC = _const : C.Int.t
+Posix.FileSys.O.TEXT = _const : C.Int.t
+Posix.FileSys.O.TRUNC = _const : C.Int.t
+Posix.FileSys.O.WRONLY = _const : C.Int.t
+Posix.FileSys.PC.2_SYMLINKS = _const : C.Int.t
+Posix.FileSys.PC.ALLOC_SIZE_MIN = _const : C.Int.t
+Posix.FileSys.PC.ASYNC_IO = _const : C.Int.t
+Posix.FileSys.PC.CHOWN_RESTRICTED = _const : C.Int.t
+Posix.FileSys.PC.FILESIZEBITS = _const : C.Int.t
+Posix.FileSys.PC.LINK_MAX = _const : C.Int.t
+Posix.FileSys.PC.MAX_CANON = _const : C.Int.t
+Posix.FileSys.PC.MAX_INPUT = _const : C.Int.t
+Posix.FileSys.PC.NAME_MAX = _const : C.Int.t
+Posix.FileSys.PC.NO_TRUNC = _const : C.Int.t
+Posix.FileSys.PC.PATH_MAX = _const : C.Int.t
+Posix.FileSys.PC.PIPE_BUF = _const : C.Int.t
+Posix.FileSys.PC.PRIO_IO = _const : C.Int.t
+Posix.FileSys.PC.REC_INCR_XFER_SIZE = _const : C.Int.t
+Posix.FileSys.PC.REC_MAX_XFER_SIZE = _const : C.Int.t
+Posix.FileSys.PC.REC_MIN_XFER_SIZE = _const : C.Int.t
+Posix.FileSys.PC.REC_XFER_ALIGN = _const : C.Int.t
+Posix.FileSys.PC.SYMLINK_MAX = _const : C.Int.t
+Posix.FileSys.PC.SYNC_IO = _const : C.Int.t
+Posix.FileSys.PC.VDISABLE = _const : C.Int.t
+Posix.FileSys.S.IFBLK = _const : C.Mode.t
+Posix.FileSys.S.IFCHR = _const : C.Mode.t
+Posix.FileSys.S.IFDIR = _const : C.Mode.t
+Posix.FileSys.S.IFIFO = _const : C.Mode.t
+Posix.FileSys.S.IFLNK = _const : C.Mode.t
+Posix.FileSys.S.IFMT = _const : C.Mode.t
+Posix.FileSys.S.IFREG = _const : C.Mode.t
+Posix.FileSys.S.IFSOCK = _const : C.Mode.t
+Posix.FileSys.S.IRGRP = _const : C.Mode.t
+Posix.FileSys.S.IROTH = _const : C.Mode.t
+Posix.FileSys.S.IRUSR = _const : C.Mode.t
+Posix.FileSys.S.IRWXG = _const : C.Mode.t
+Posix.FileSys.S.IRWXO = _const : C.Mode.t
+Posix.FileSys.S.IRWXU = _const : C.Mode.t
+Posix.FileSys.S.ISGID = _const : C.Mode.t
+Posix.FileSys.S.ISUID = _const : C.Mode.t
+Posix.FileSys.S.ISVTX = _const : C.Mode.t
+Posix.FileSys.S.IWGRP = _const : C.Mode.t
+Posix.FileSys.S.IWOTH = _const : C.Mode.t
+Posix.FileSys.S.IWUSR = _const : C.Mode.t
+Posix.FileSys.S.IXGRP = _const : C.Mode.t
+Posix.FileSys.S.IXOTH = _const : C.Mode.t
+Posix.FileSys.S.IXUSR = _const : C.Mode.t
+Posix.FileSys.ST.isBlk = _import : C.Mode.t -> Bool.t
+Posix.FileSys.ST.isChr = _import : C.Mode.t -> Bool.t
+Posix.FileSys.ST.isDir = _import : C.Mode.t -> Bool.t
+Posix.FileSys.ST.isFIFO = _import : C.Mode.t -> Bool.t
+Posix.FileSys.ST.isLink = _import : C.Mode.t -> Bool.t
+Posix.FileSys.ST.isReg = _import : C.Mode.t -> Bool.t
+Posix.FileSys.ST.isSock = _import : C.Mode.t -> Bool.t
+Posix.FileSys.Stat.fstat = _import : C.Fd.t -> C.Int.t C.Errno.t
+Posix.FileSys.Stat.getATime = _import : unit -> C.Time.t
+# Posix.FileSys.Stat.getBlkCnt = _import : unit -> C.BlkCnt.t
+# Posix.FileSys.Stat.getBlkSize = _import : unit -> C.BlkSize.t
+Posix.FileSys.Stat.getCTime = _import : unit -> C.Time.t
+Posix.FileSys.Stat.getDev = _import : unit -> C.Dev.t
+Posix.FileSys.Stat.getGId = _import : unit -> C.GId.t
+Posix.FileSys.Stat.getINo = _import : unit -> C.INo.t
+Posix.FileSys.Stat.getMTime = _import : unit -> C.Time.t
+Posix.FileSys.Stat.getMode = _import : unit -> C.Mode.t
+Posix.FileSys.Stat.getNLink = _import : unit -> C.NLink.t
+Posix.FileSys.Stat.getRDev = _import : unit -> C.Dev.t
+Posix.FileSys.Stat.getSize = _import : unit -> C.Off.t
+Posix.FileSys.Stat.getUId = _import : unit -> C.UId.t
+Posix.FileSys.Stat.lstat = _import : NullString8.t -> C.Int.t C.Errno.t
+Posix.FileSys.Stat.stat = _import : NullString8.t -> C.Int.t C.Errno.t
+Posix.FileSys.Utimbuf.setAcTime = _import : C.Time.t -> unit
+Posix.FileSys.Utimbuf.setModTime = _import : C.Time.t -> unit
+Posix.FileSys.Utimbuf.utime = _import : NullString8.t -> C.Int.t C.Errno.t
+Posix.FileSys.access = _import : NullString8.t * C.Int.t -> C.Int.t C.Errno.t
+Posix.FileSys.chdir = _import : NullString8.t -> C.Int.t C.Errno.t
+Posix.FileSys.chmod = _import : NullString8.t * C.Mode.t -> C.Int.t C.Errno.t
+Posix.FileSys.chown = _import : NullString8.t * C.UId.t * C.GId.t -> C.Int.t C.Errno.t
+Posix.FileSys.fchdir = _import : C.Fd.t -> C.Int.t C.Errno.t
+Posix.FileSys.fchmod = _import : C.Fd.t * C.Mode.t -> C.Int.t C.Errno.t
+Posix.FileSys.fchown = _import : C.Fd.t * C.UId.t * C.GId.t -> C.Int.t C.Errno.t
+Posix.FileSys.fpathconf = _import : C.Fd.t * C.Int.t -> C.Long.t C.Errno.t
+Posix.FileSys.ftruncate = _import : C.Fd.t * C.Off.t -> C.Int.t C.Errno.t
+Posix.FileSys.getcwd = _import : Char8.t array * C.Size.t -> C.String.t C.Errno.t
+Posix.FileSys.link = _import : NullString8.t * NullString8.t -> C.Int.t C.Errno.t
+Posix.FileSys.mkdir = _import : NullString8.t * C.Mode.t -> C.Int.t C.Errno.t
+Posix.FileSys.mkfifo = _import : NullString8.t * C.Mode.t -> C.Int.t C.Errno.t
+Posix.FileSys.open2 = _import : NullString8.t * C.Int.t -> C.Fd.t C.Errno.t
+Posix.FileSys.open3 = _import : NullString8.t * C.Int.t * C.Mode.t -> C.Fd.t C.Errno.t
+Posix.FileSys.pathconf = _import : NullString8.t * C.Int.t -> C.Long.t C.Errno.t
+Posix.FileSys.readlink = _import : NullString8.t * Char8.t array * C.Size.t -> C.SSize.t C.Errno.t
+Posix.FileSys.rename = _import : NullString8.t * NullString8.t -> C.Int.t C.Errno.t
+Posix.FileSys.rmdir = _import : NullString8.t -> C.Int.t C.Errno.t
+Posix.FileSys.symlink = _import : NullString8.t * NullString8.t -> C.Int.t C.Errno.t
+Posix.FileSys.truncate = _import : NullString8.t * C.Off.t -> C.Int.t C.Errno.t
+Posix.FileSys.umask = _import : C.Mode.t -> C.Mode.t
+Posix.FileSys.unlink = _import : NullString8.t -> C.Int.t C.Errno.t
+Posix.IO.FD_CLOEXEC = _const : C.Fd.t
+Posix.IO.FLock.F_GETLK = _const : C.Int.t
+Posix.IO.FLock.F_SETLK = _const : C.Int.t
+Posix.IO.FLock.F_SETLKW = _const : C.Int.t
+Posix.IO.FLock.fcntl = _import : C.Fd.t * C.Int.t -> C.Int.t C.Errno.t
+Posix.IO.FLock.getLen = _import : unit -> C.Off.t
+Posix.IO.FLock.getPId = _import : unit -> C.PId.t
+Posix.IO.FLock.getStart = _import : unit -> C.Off.t
+Posix.IO.FLock.getType = _import : unit -> C.Short.t
+Posix.IO.FLock.getWhence = _import : unit -> C.Short.t
+Posix.IO.FLock.setLen = _import : C.Off.t -> unit
+Posix.IO.FLock.setPId = _import : C.PId.t -> unit
+Posix.IO.FLock.setStart = _import : C.Off.t -> unit
+Posix.IO.FLock.setType = _import : C.Short.t -> unit
+Posix.IO.FLock.setWhence = _import : C.Short.t -> unit
+Posix.IO.F_DUPFD = _const : C.Int.t
+Posix.IO.F_GETFD = _const : C.Int.t
+Posix.IO.F_GETFL = _const : C.Int.t
+Posix.IO.F_GETOWN = _const : C.Int.t
+Posix.IO.F_SETFD = _const : C.Int.t
+Posix.IO.F_SETFL = _const : C.Int.t
+Posix.IO.F_SETOWN = _const : C.Int.t
+Posix.IO.O_ACCMODE = _const : C.Int.t
+Posix.IO.SEEK_CUR = _const : C.Int.t
+Posix.IO.SEEK_END= _const : C.Int.t
+Posix.IO.SEEK_SET = _const : C.Int.t
+Posix.IO.close = _import : C.Fd.t -> C.Int.t C.Errno.t
+Posix.IO.dup = _import : C.Fd.t -> C.Fd.t C.Errno.t
+Posix.IO.dup2 = _import : C.Fd.t * C.Fd.t -> C.Fd.t C.Errno.t
+Posix.IO.fcntl2 = _import : C.Fd.t * C.Int.t -> C.Int.t C.Errno.t
+Posix.IO.fcntl3 = _import : C.Fd.t * C.Int.t * C.Int.t -> C.Int.t C.Errno.t
+Posix.IO.fsync = _import : C.Fd.t -> C.Int.t C.Errno.t
+Posix.IO.lseek = _import : C.Fd.t * C.Off.t * C.Int.t -> C.Off.t C.Errno.t
+Posix.IO.pipe = _import : C.Fd.t vector -> C.Int.t C.Errno.t
+Posix.IO.readChar8 = _import : C.Fd.t * Char8.t array * C.Int.t * C.Size.t -> C.SSize.t C.Errno.t
+Posix.IO.readWord8 = _import : C.Fd.t * Word8.t array * C.Int.t * C.Size.t -> C.SSize.t C.Errno.t
+Posix.IO.setbin = _import : C.Fd.t -> unit
+Posix.IO.settext = _import : C.Fd.t -> unit
+Posix.IO.writeChar8Arr = _import : C.Fd.t * Char8.t array * C.Int.t * C.Size.t -> C.SSize.t C.Errno.t
+Posix.IO.writeChar8Vec = _import : C.Fd.t * Char8.t vector * C.Int.t * C.Size.t -> C.SSize.t C.Errno.t
+Posix.IO.writeWord8Arr = _import : C.Fd.t * Word8.t array * C.Int.t * C.Size.t -> C.SSize.t C.Errno.t
+Posix.IO.writeWord8Vec = _import : C.Fd.t * Word8.t vector * C.Int.t * C.Size.t -> C.SSize.t C.Errno.t
+Posix.ProcEnv.SC_2_CHAR_TERM = _const : C.Int.t
+Posix.ProcEnv.SC_2_C_BIND = _const : C.Int.t
+Posix.ProcEnv.SC_2_C_DEV = _const : C.Int.t
+Posix.ProcEnv.SC_2_FORT_DEV = _const : C.Int.t
+Posix.ProcEnv.SC_2_FORT_RUN = _const : C.Int.t
+Posix.ProcEnv.SC_2_LOCALEDEF = _const : C.Int.t
+Posix.ProcEnv.SC_2_PBS = _const : C.Int.t
+Posix.ProcEnv.SC_2_PBS_ACCOUNTING = _const : C.Int.t
+Posix.ProcEnv.SC_2_PBS_CHECKPOINT = _const : C.Int.t
+Posix.ProcEnv.SC_2_PBS_LOCATE = _const : C.Int.t
+Posix.ProcEnv.SC_2_PBS_MESSAGE = _const : C.Int.t
+Posix.ProcEnv.SC_2_PBS_TRACK = _const : C.Int.t
+Posix.ProcEnv.SC_2_SW_DEV = _const : C.Int.t
+Posix.ProcEnv.SC_2_UPE = _const : C.Int.t
+Posix.ProcEnv.SC_2_VERSION = _const : C.Int.t
+Posix.ProcEnv.SC_ADVISORY_INFO = _const : C.Int.t
+Posix.ProcEnv.SC_AIO_LISTIO_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_AIO_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_AIO_PRIO_DELTA_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_ARG_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_ASYNCHRONOUS_IO = _const : C.Int.t
+Posix.ProcEnv.SC_ATEXIT_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_BARRIERS = _const : C.Int.t
+Posix.ProcEnv.SC_BC_BASE_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_BC_DIM_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_BC_SCALE_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_BC_STRING_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_CHILD_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_CLK_TCK = _const : C.Int.t
+Posix.ProcEnv.SC_CLOCK_SELECTION = _const : C.Int.t
+Posix.ProcEnv.SC_COLL_WEIGHTS_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_CPUTIME = _const : C.Int.t
+Posix.ProcEnv.SC_DELAYTIMER_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_EXPR_NEST_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_FSYNC = _const : C.Int.t
+Posix.ProcEnv.SC_GETGR_R_SIZE_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_GETPW_R_SIZE_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_HOST_NAME_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_IOV_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_IPV6 = _const : C.Int.t
+Posix.ProcEnv.SC_JOB_CONTROL = _const : C.Int.t
+Posix.ProcEnv.SC_LINE_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_LOGIN_NAME_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_MAPPED_FILES = _const : C.Int.t
+Posix.ProcEnv.SC_MEMLOCK = _const : C.Int.t
+Posix.ProcEnv.SC_MEMLOCK_RANGE = _const : C.Int.t
+Posix.ProcEnv.SC_MEMORY_PROTECTION = _const : C.Int.t
+Posix.ProcEnv.SC_MESSAGE_PASSING = _const : C.Int.t
+Posix.ProcEnv.SC_MONOTONIC_CLOCK = _const : C.Int.t
+Posix.ProcEnv.SC_MQ_OPEN_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_MQ_PRIO_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_NGROUPS_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_OPEN_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_PAGESIZE = _const : C.Int.t
+Posix.ProcEnv.SC_PAGE_SIZE = _const : C.Int.t
+Posix.ProcEnv.SC_PRIORITIZED_IO = _const : C.Int.t
+Posix.ProcEnv.SC_PRIORITY_SCHEDULING = _const : C.Int.t
+Posix.ProcEnv.SC_RAW_SOCKETS = _const : C.Int.t
+Posix.ProcEnv.SC_READER_WRITER_LOCKS = _const : C.Int.t
+Posix.ProcEnv.SC_REALTIME_SIGNALS = _const : C.Int.t
+Posix.ProcEnv.SC_REGEXP = _const : C.Int.t
+Posix.ProcEnv.SC_RE_DUP_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_RTSIG_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_SAVED_IDS = _const : C.Int.t
+Posix.ProcEnv.SC_SEMAPHORES = _const : C.Int.t
+Posix.ProcEnv.SC_SEM_NSEMS_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_SEM_VALUE_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_SHARED_MEMORY_OBJECTS = _const : C.Int.t
+Posix.ProcEnv.SC_SHELL = _const : C.Int.t
+Posix.ProcEnv.SC_SIGQUEUE_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_SPAWN = _const : C.Int.t
+Posix.ProcEnv.SC_SPIN_LOCKS = _const : C.Int.t
+Posix.ProcEnv.SC_SPORADIC_SERVER = _const : C.Int.t
+Posix.ProcEnv.SC_SS_REPL_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_STREAM_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_SYMLOOP_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_SYNCHRONIZED_IO = _const : C.Int.t
+Posix.ProcEnv.SC_THREADS = _const : C.Int.t
+Posix.ProcEnv.SC_THREAD_ATTR_STACKADDR = _const : C.Int.t
+Posix.ProcEnv.SC_THREAD_ATTR_STACKSIZE = _const : C.Int.t
+Posix.ProcEnv.SC_THREAD_CPUTIME = _const : C.Int.t
+Posix.ProcEnv.SC_THREAD_DESTRUCTOR_ITERATIONS = _const : C.Int.t
+Posix.ProcEnv.SC_THREAD_KEYS_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_THREAD_PRIORITY_SCHEDULING = _const : C.Int.t
+Posix.ProcEnv.SC_THREAD_PRIO_INHERIT = _const : C.Int.t
+Posix.ProcEnv.SC_THREAD_PRIO_PROTECT = _const : C.Int.t
+Posix.ProcEnv.SC_THREAD_PROCESS_SHARED = _const : C.Int.t
+Posix.ProcEnv.SC_THREAD_SAFE_FUNCTIONS = _const : C.Int.t
+Posix.ProcEnv.SC_THREAD_SPORADIC_SERVER = _const : C.Int.t
+Posix.ProcEnv.SC_THREAD_STACK_MIN = _const : C.Int.t
+Posix.ProcEnv.SC_THREAD_THREADS_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_TIMEOUTS = _const : C.Int.t
+Posix.ProcEnv.SC_TIMERS = _const : C.Int.t
+Posix.ProcEnv.SC_TIMER_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_TRACE = _const : C.Int.t
+Posix.ProcEnv.SC_TRACE_EVENT_FILTER = _const : C.Int.t
+Posix.ProcEnv.SC_TRACE_EVENT_NAME_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_TRACE_INHERIT = _const : C.Int.t
+Posix.ProcEnv.SC_TRACE_LOG = _const : C.Int.t
+Posix.ProcEnv.SC_TRACE_NAME_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_TRACE_SYS_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_TRACE_USER_EVENT_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_TTY_NAME_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_TYPED_MEMORY_OBJECTS = _const : C.Int.t
+Posix.ProcEnv.SC_TZNAME_MAX = _const : C.Int.t
+Posix.ProcEnv.SC_V6_ILP32_OFF32 = _const : C.Int.t
+Posix.ProcEnv.SC_V6_ILP32_OFFBIG = _const : C.Int.t
+Posix.ProcEnv.SC_V6_LP64_OFF64 = _const : C.Int.t
+Posix.ProcEnv.SC_V6_LPBIG_OFFBIG = _const : C.Int.t
+Posix.ProcEnv.SC_VERSION = _const : C.Int.t
+Posix.ProcEnv.SC_XBS5_ILP32_OFF32 = _const : C.Int.t
+Posix.ProcEnv.SC_XBS5_ILP32_OFFBIG = _const : C.Int.t
+Posix.ProcEnv.SC_XBS5_LP64_OFF64 = _const : C.Int.t
+Posix.ProcEnv.SC_XBS5_LPBIG_OFFBIG = _const : C.Int.t
+Posix.ProcEnv.SC_XOPEN_CRYPT = _const : C.Int.t
+Posix.ProcEnv.SC_XOPEN_ENH_I18N = _const : C.Int.t
+Posix.ProcEnv.SC_XOPEN_LEGACY = _const : C.Int.t
+Posix.ProcEnv.SC_XOPEN_REALTIME = _const : C.Int.t
+Posix.ProcEnv.SC_XOPEN_REALTIME_THREADS = _const : C.Int.t
+Posix.ProcEnv.SC_XOPEN_SHM = _const : C.Int.t
+Posix.ProcEnv.SC_XOPEN_STREAMS = _const : C.Int.t
+Posix.ProcEnv.SC_XOPEN_UNIX = _const : C.Int.t
+Posix.ProcEnv.SC_XOPEN_VERSION = _const : C.Int.t
+Posix.ProcEnv.Times.getCSTime = _import : unit -> C.Clock.t
+Posix.ProcEnv.Times.getCUTime = _import : unit -> C.Clock.t
+Posix.ProcEnv.Times.getSTime = _import : unit -> C.Clock.t
+Posix.ProcEnv.Times.getUTime = _import : unit -> C.Clock.t
+Posix.ProcEnv.Uname.getMachine = _import : unit -> C.String.t
+Posix.ProcEnv.Uname.getNodeName = _import : unit -> C.String.t
+Posix.ProcEnv.Uname.getRelease = _import : unit -> C.String.t
+Posix.ProcEnv.Uname.getSysName = _import : unit -> C.String.t
+Posix.ProcEnv.Uname.getVersion = _import : unit -> C.String.t
+Posix.ProcEnv.ctermid = _import : unit -> C.String.t
+Posix.ProcEnv.environ = _symbol : C.StringArray.t
+Posix.ProcEnv.getegid = _import : unit -> C.GId.t
+Posix.ProcEnv.getenv = _import : NullString8.t -> C.String.t
+Posix.ProcEnv.geteuid = _import : unit -> C.UId.t
+Posix.ProcEnv.getgid = _import : unit -> C.GId.t
+Posix.ProcEnv.getgroups = _import : C.Int.t * C.GId.t array -> C.Int.t C.Errno.t
+Posix.ProcEnv.getlogin = _import : unit -> C.String.t C.Errno.t
+Posix.ProcEnv.getpgrp = _import : unit -> C.PId.t
+Posix.ProcEnv.getpid = _import : unit -> C.PId.t
+Posix.ProcEnv.getppid = _import : unit -> C.PId.t
+Posix.ProcEnv.getuid = _import : unit -> C.UId.t
+Posix.ProcEnv.isatty = _import : C.Fd.t -> Bool.t
+Posix.ProcEnv.setenv = _import : NullString8.t * NullString8.t -> C.Int.t C.Errno.t
+Posix.ProcEnv.setgid = _import : C.GId.t -> C.Int.t C.Errno.t
+Posix.ProcEnv.setgroups = _import : C.Int.t * C.GId.t vector -> C.Int.t C.Errno.t
+Posix.ProcEnv.setpgid = _import : C.PId.t * C.GId.t -> C.Int.t C.Errno.t
+Posix.ProcEnv.setsid = _import : unit -> C.PId.t C.Errno.t
+Posix.ProcEnv.setuid = _import : C.UId.t -> C.Int.t C.Errno.t
+Posix.ProcEnv.sysconf = _import : C.Int.t -> C.Long.t C.Errno.t
+Posix.ProcEnv.times = _import : unit -> C.Clock.t C.Errno.t
+Posix.ProcEnv.ttyname = _import : C.Fd.t -> C.String.t C.Errno.t
+Posix.ProcEnv.uname = _import : unit -> C.Int.t C.Errno.t
+Posix.Process.W.CONTINUED = _const : C.Int.t
+Posix.Process.W.NOHANG = _const : C.Int.t
+Posix.Process.W.UNTRACED = _const : C.Int.t
+Posix.Process.alarm = _import : C.UInt.t -> C.UInt.t
+Posix.Process.exece = _import : NullString8.t * NullString8Array.t * NullString8Array.t -> C.Int.t C.Errno.t
+Posix.Process.execp = _import : NullString8.t * NullString8Array.t -> C.Int.t C.Errno.t
+Posix.Process.exit = _import : C.Status.t -> unit
+Posix.Process.exitStatus = _import : C.Status.t -> C.Int.t
+Posix.Process.fork = _import : unit -> C.PId.t C.Errno.t
+Posix.Process.ifExited = _import : C.Status.t -> Bool.t
+Posix.Process.ifSignaled = _import : C.Status.t -> Bool.t
+Posix.Process.ifStopped = _import : C.Status.t -> Bool.t
+Posix.Process.kill = _import : C.PId.t * C.Signal.t -> C.Int.t C.Errno.t
+Posix.Process.nanosleep = _import : C.Time.t ref * C.Long.t ref -> C.Int.t C.Errno.t
+Posix.Process.pause = _import : unit -> C.Int.t C.Errno.t
+Posix.Process.sleep = _import : C.UInt.t -> C.UInt.t
+Posix.Process.stopSig = _import : C.Status.t -> C.Signal.t
+Posix.Process.system = _import : NullString8.t -> C.Status.t C.Errno.t
+Posix.Process.termSig = _import : C.Status.t -> C.Signal.t
+Posix.Process.waitpid = _import : C.PId.t * C.Int.t ref * C.Int.t -> C.PId.t C.Errno.t
+Posix.Signal.NSIG = _const : C.Int.t
+Posix.Signal.SIGABRT = _const : C.Signal.t
+Posix.Signal.SIGALRM = _const : C.Signal.t
+Posix.Signal.SIGBUS = _const : C.Signal.t
+Posix.Signal.SIGCHLD = _const : C.Signal.t
+Posix.Signal.SIGCONT = _const : C.Signal.t
+Posix.Signal.SIGFPE = _const : C.Signal.t
+Posix.Signal.SIGHUP = _const : C.Signal.t
+Posix.Signal.SIGILL = _const : C.Signal.t
+Posix.Signal.SIGINT = _const : C.Signal.t
+Posix.Signal.SIGKILL = _const : C.Signal.t
+Posix.Signal.SIGPIPE = _const : C.Signal.t
+Posix.Signal.SIGPOLL = _const : C.Signal.t
+Posix.Signal.SIGPROF = _const : C.Signal.t
+Posix.Signal.SIGQUIT = _const : C.Signal.t
+Posix.Signal.SIGSEGV = _const : C.Signal.t
+Posix.Signal.SIGSTOP = _const : C.Signal.t
+Posix.Signal.SIGSYS = _const : C.Signal.t
+Posix.Signal.SIGTERM = _const : C.Signal.t
+Posix.Signal.SIGTRAP = _const : C.Signal.t
+Posix.Signal.SIGTSTP = _const : C.Signal.t
+Posix.Signal.SIGTTIN = _const : C.Signal.t
+Posix.Signal.SIGTTOU = _const : C.Signal.t
+Posix.Signal.SIGURG = _const : C.Signal.t
+Posix.Signal.SIGUSR1 = _const : C.Signal.t
+Posix.Signal.SIGUSR2 = _const : C.Signal.t
+Posix.Signal.SIGVTALRM = _const : C.Signal.t
+Posix.Signal.SIGXCPU = _const : C.Signal.t
+Posix.Signal.SIGXFSZ = _const : C.Signal.t
+Posix.Signal.default = _import : C.Signal.t -> C.Int.t C.Errno.t
+Posix.Signal.handle = _import : C.Signal.t -> C.Int.t C.Errno.t
+Posix.Signal.handleGC = _import : unit -> unit
+Posix.Signal.ignore = _import : C.Signal.t -> C.Int.t C.Errno.t
+Posix.Signal.isDefault = _import : C.Signal.t * Bool.t ref -> C.Int.t C.Errno.t
+Posix.Signal.isIgnore = _import : C.Signal.t * Bool.t ref -> C.Int.t C.Errno.t
+Posix.Signal.isPending = _import : C.Signal.t -> Bool.t
+Posix.Signal.isPendingGC = _import : unit -> Bool.t
+Posix.Signal.resetPending = _import :unit -> unit
+Posix.Signal.sigaddset = _import : C.Signal.t -> C.Int.t C.Errno.t
+Posix.Signal.sigdelset = _import : C.Signal.t -> C.Int.t C.Errno.t
+Posix.Signal.sigemptyset = _import : unit -> C.Int.t C.Errno.t
+Posix.Signal.sigfillset = _import : unit -> C.Int.t C.Errno.t
+Posix.Signal.sigismember = _import : C.Signal.t -> C.Int.t C.Errno.t
+Posix.Signal.sigprocmask = _import : C.Int.t -> C.Int.t C.Errno.t
+Posix.Signal.sigsuspend = _import : unit -> unit
+Posix.SysDB.Group.getGId = _import : unit -> C.GId.t
+Posix.SysDB.Group.getMem = _import : unit -> C.StringArray.t
+Posix.SysDB.Group.getName = _import : unit -> C.String.t
+Posix.SysDB.Passwd.getDir = _import : unit -> C.String.t
+Posix.SysDB.Passwd.getGId = _import : unit -> C.GId.t
+Posix.SysDB.Passwd.getName = _import : unit -> C.String.t
+Posix.SysDB.Passwd.getShell = _import : unit -> C.String.t
+Posix.SysDB.Passwd.getUId = _import : unit -> C.UId.t
+Posix.SysDB.getgrgid = _import : C.GId.t -> Bool.t
+Posix.SysDB.getgrnam = _import : NullString8.t -> Bool.t
+Posix.SysDB.getpwnam = _import : NullString8.t -> Bool.t
+Posix.SysDB.getpwuid = _import : C.GId.t -> Bool.t
Posix.TTY.B0 = _const : C.Speed.t
Posix.TTY.B110 = _const : C.Speed.t
Posix.TTY.B1200 = _const : C.Speed.t
@@ -350,38 +741,15 @@
Socket.listen = _import : C.Sock.t * C.Int.t -> C.Int.t C.Errno.t
Socket.recv = _import : C.Sock.t * Word8.t array * C.Int.t * C.Size.t * C.Int.t -> C.SSize.t C.Errno.t
Socket.recvFrom = _import : C.Sock.t * Word8.t array * C.Int.t * C.Size.t * C.Int.t * Word8.t array * C.Socklen.t ref -> C.SSize.t C.Errno.t
-Socket.send = _import : C.Sock.t * Word8.t vector * C.Int.t * C.Size.t * C.Int.t -> C.SSize.t C.Errno.t
-Socket.sendTo = _import : C.Sock.t * Word8.t vector * C.Int.t * C.Size.t * C.Int.t * Word8.t vector * C.Socklen.t -> C.SSize.t C.Errno.t
+Socket.sendArr = _import : C.Sock.t * Word8.t array * C.Int.t * C.Size.t * C.Int.t -> C.SSize.t C.Errno.t
+Socket.sendArrTo = _import : C.Sock.t * Word8.t array * C.Int.t * C.Size.t * C.Int.t * Word8.t vector * C.Socklen.t -> C.SSize.t C.Errno.t
+Socket.sendVec = _import : C.Sock.t * Word8.t vector * C.Int.t * C.Size.t * C.Int.t -> C.SSize.t C.Errno.t
+Socket.sendVecTo = _import : C.Sock.t * Word8.t vector * C.Int.t * C.Size.t * C.Int.t * Word8.t vector * C.Socklen.t -> C.SSize.t C.Errno.t
Socket.shutdown = _import : C.Sock.t * C.Int.t -> C.Int.t C.Errno.t
Socket.sockAddrStorageLen = _const : C.Size.t
Stdio.print = _import : String8.t -> unit
Time.getTimeOfDay = _import : unit -> C.Int.t
Time.sec = _import : unit -> C.Time.t
Time.usec = _import : unit -> C.SUSeconds.t
-Posix.FileSys.Dirstream.closeDir = _import : C.DirP.t -> C.Int.t C.Errno.t
-Posix.FileSys.Dirstream.openDir = _import : NullString8.t -> C.DirP.t C.Errno.t
-Posix.FileSys.Dirstream.readDir = _import : C.DirP.t -> C.String.t C.Errno.t
-Posix.FileSys.Dirstream.rewindDir = _import : C.DirP.t -> unit
-Posix.FileSys.ST.isDir = _import : C.Mode.t -> Bool.t
-Posix.FileSys.ST.isChr = _import : C.Mode.t -> Bool.t
-Posix.FileSys.ST.isBlk = _import : C.Mode.t -> Bool.t
-Posix.FileSys.ST.isReg = _import : C.Mode.t -> Bool.t
-Posix.FileSys.ST.isFIFO = _import : C.Mode.t -> Bool.t
-Posix.FileSys.ST.isLink = _import : C.Mode.t -> Bool.t
-Posix.FileSys.ST.isSock = _import : C.Mode.t -> Bool.t
-Posix.FileSys.Stat.getDev = _import : unit -> C.Dev.t
-Posix.FileSys.Stat.getINo = _import : unit -> C.INo.t
-Posix.FileSys.Stat.getMode = _import : unit -> C.Mode.t
-Posix.FileSys.Stat.getNLink = _import : unit -> C.NLink.t
-Posix.FileSys.Stat.getUId = _import : unit -> C.UId.t
-Posix.FileSys.Stat.getGId = _import : unit -> C.GId.t
-Posix.FileSys.Stat.getRDev = _import : unit -> C.Dev.t
-Posix.FileSys.Stat.getSize = _import : unit -> C.Off.t
-Posix.FileSys.Stat.getATime = _import : unit -> C.Time.t
-Posix.FileSys.Stat.getCTime = _import : unit -> C.Time.t
-Posix.FileSys.Stat.getMTime = _import : unit -> C.Time.t
-Posix.FileSys.Stat.fstat = _import : C.Fd.t -> C.Int.t C.Errno.t
-Posix.FileSys.Stat.lstat = _import : NullString8.t -> C.Int.t C.Errno.t
-Posix.FileSys.Stat.stat = _import : NullString8.t -> C.Int.t C.Errno.t
-Posix.FileSys.Stat.getBlkSize = _import : unit -> C.BlkSize.t
-Posix.FileSys.Stat.getBlkCnt = _import : unit -> C.BlkCnt.t
+Windows.Process.create = _import : NullString8_t * NullString8_t * NullString8_t * C.Fd.t * C.Fd.t * C.Fd.t -> C.PId.t C.Errno.t
+Windows.Process.terminate = _import : C.PId.t * C.Signal.t -> C.Int.t C.Errno.t
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-basis-ffi.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-basis-ffi.sml 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-basis-ffi.sml 2006-01-26 03:06:35 UTC (rev 4307)
@@ -240,11 +240,11 @@
val s = Substring.droplSpace s
val s = if Substring.isPrefix ":" s
then #2 (Substring.splitAt (s, 1))
- else raise Fail (concat ["Entry.parseSymbol: \"", Substring.string s, "\""])
+ else raise Fail (concat ["Entry.parseConst: \"", Substring.string s, "\""])
val (ret, rest) = Type.parse s
val () = if Substring.isEmpty rest
then ()
- else raise Fail (concat ["Entry.parseSymbol: \"", Substring.string s, "\""])
+ else raise Fail (concat ["Entry.parseConst: \"", Substring.string s, "\""])
in
Const {name = name,
ty = ret}
@@ -308,11 +308,14 @@
fun loop entries =
case TextIO.inputLine f of
NONE => List.rev entries
- | SOME s => let
- val entry = Entry.parse (Substring.full s)
- in
- loop (entry :: entries)
- end
+ | SOME s =>
+ if String.isPrefix "#" s
+ then loop entries
+ else let
+ val entry = Entry.parse (Substring.full s)
+ in
+ loop (entry :: entries)
+ end
val entries = loop []
val () = TextIO.closeIn f
val entries = List.sort Entry.compare entries
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-types.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-types.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-types.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -42,7 +42,7 @@
static char* stdtypes[] = {
"/* ML types */",
- "typedef unsigned char* Pointer;",
+ "typedef unsigned char* /* uintptr_t */ Pointer;",
"#define Array(t) Pointer",
"#define Ref(t) Pointer",
"#define Vector(t) const Pointer",
@@ -59,6 +59,8 @@
"typedef float Real32;",
"typedef double Real64_t;",
"typedef double Real64;",
+ // "typedef long double Real128_t;",
+ // "typedef long double Real128;",
"typedef uint8_t Word8_t;",
"typedef uint8_t Word8;",
"typedef uint16_t Word16_t;",
@@ -102,33 +104,33 @@
"",
"typedef Int32_t Bool_t;",
"typedef Int32_t Bool;",
- "typedef Char8_t Char_t;",
- "typedef Char8_t Char;",
+ // "typedef Char8_t Char_t;",
+ // "typedef Char8_t Char;",
"typedef Int32_t Int_t;",
"typedef Int32_t Int;",
- "typedef Real64_t Real_t;",
- "typedef Real64_t Real;",
- "typedef String8_t String_t;",
- "typedef String8_t String;",
+ // "typedef Real64_t Real_t;",
+ // "typedef Real64_t Real;",
+ // "typedef String8_t String_t;",
+ // "typedef String8_t String;",
"typedef Word32_t Word_t;",
"typedef Word32_t Word;",
""
"typedef String8_t NullString8_t;",
"typedef String8_t NullString8;",
- "typedef NullString8_t NullString_t;",
- "typedef NullString8_t NullString;",
+ "typedef Array(NullString8_t) NullString8Array_t;",
+ "typedef Array(NullString8_t) NullString8Array;",
NULL
};
#define systype(t, bt, name) \
do { \
writeString (fd, "typedef "); \
+ writeString (fd, "/* "); \
writeString (fd, #t); \
- writeString (fd, " /* "); \
+ writeString (fd, " */ "); \
writeString (fd, bt); \
writeUintmaxU (fd, CHAR_BIT * sizeof(t));\
writeString (fd, "_t "); \
- writeString (fd, "*/ "); \
writeString (fd, name); \
writeString (fd, ";"); \
writeNewline (fd); \
@@ -151,24 +153,7 @@
static char* suffix[] = {
"",
"#define C_Errno_t(t) t",
- "#define C_HErrno_t(t) t",
"",
- "typedef C_Pointer_t Cpointer;",
- "typedef C_Size_t Size;",
- "typedef C_SSize_t Ssize;",
- "typedef C_String_t Cstring;",
- "typedef C_StringArray_t CstringArray;",
- "typedef C_Off_t Position;"
- "",
- "typedef C_Fd_t Fd;",
- "typedef C_GId_t Gid;",
- "typedef C_Mode_t Mode;",
- "typedef C_PId_t Pid;",
- "typedef C_Resource Resource;",
- "typedef C_Signal Signal;",
- "typedef C_Status Status;",
- "typedef C_UId_t Uid;",
- "",
"#endif /* _MLTON_TYPES_H_ */",
NULL
};
@@ -176,6 +161,7 @@
int main (int argc, char* argv[]) {
int fd;
+ unlink_safe ("types.h");
fd = open_safe ("types.h", O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
for (int i = 0; prefix[i] != NULL; i++) {
writeString (fd, prefix[i]);
@@ -219,6 +205,8 @@
writeString (fd, "/* Generic integers */");
writeNewline (fd);
systype(int, "Int", "C_Fd_t");
+ systype(int, "Int", "C_Signal_t");
+ systype(int, "Int", "C_Status_t");
systype(int, "Int", "C_Sock_t");
writeNewline (fd);
writeString (fd, "/* from <dirent.h> */");
@@ -235,12 +223,12 @@
writeNewline (fd);
writeString (fd, "/* from <sys/types.h> */");
writeNewline (fd);
- systype(blkcnt_t, "Int", "C_BlkCnt_t");
- systype(blksize_t, "Int", "C_BlkSize_t");
- chknumsystype(clock_t, "C_Clock");
+ // systype(blkcnt_t, "Int", "C_BlkCnt_t");
+ // systype(blksize_t, "Int", "C_BlkSize_t");
+ chknumsystype(clock_t, "C_Clock_t");
chknumsystype(dev_t, "C_Dev_t");
chkintsystype(gid_t, "C_GId_t");
- chkintsystype(id_t, "C_Id");
+ chkintsystype(id_t, "C_Id_t");
systype(ino_t, "Word", "C_INo_t");
chkintsystype(mode_t, "C_Mode_t");
chkintsystype(nlink_t, "C_NLink_t");
@@ -252,7 +240,7 @@
chkintsystype(uid_t, "C_UId_t");
systype(useconds_t, "Word", "C_USeconds_t");
writeNewline (fd);
- writeString (fd, "/* from <sys/types.h> */");
+ writeString (fd, "/* from <sys/socket.h> */");
writeNewline (fd);
chkintsystype(socklen_t, "C_Socklen_t");
writeNewline (fd);
@@ -262,12 +250,6 @@
systype(speed_t, "Word", "C_Speed_t");
systype(tcflag_t, "Word", "C_TCFlag_t");
writeNewline (fd);
- writeString (fd, "/* Misc */");
- writeNewline (fd);
- systype(int, "Int", "C_Resource");
- systype(int, "Int", "C_Signal");
- systype(int, "Int", "C_Status");
- writeNewline (fd);
for (int i = 0; suffix[i] != NULL; i++) {
writeString (fd, suffix[i]);
writeNewline (fd);
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.h 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.h 2006-01-26 03:06:35 UTC (rev 4307)
@@ -25,7 +25,6 @@
#define HAS_FPCLASSIFY TRUE
#define HAS_FEROUND FALSE
-#define HAS_PTRACE FALSE
#define HAS_REMAP FALSE
#define HAS_SIGALTSTACK FALSE
#define HAS_SIGNBIT TRUE
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.h 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.h 2006-01-26 03:06:35 UTC (rev 4307)
@@ -25,7 +25,6 @@
#define HAS_FEROUND TRUE
#define HAS_FPCLASSIFY TRUE
-#define HAS_PTRACE FALSE
#define HAS_REMAP FALSE
#define HAS_SIGALTSTACK TRUE
#define HAS_SIGNBIT TRUE
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/freebsd.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/freebsd.h 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/freebsd.h 2006-01-26 03:06:35 UTC (rev 4307)
@@ -25,7 +25,6 @@
#define HAS_FEROUND TRUE
#define HAS_FPCLASSIFY TRUE
-#define HAS_PTRACE TRUE
#define HAS_REMAP FALSE
#define HAS_SIGALTSTACK TRUE
#define HAS_SIGNBIT TRUE
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -71,11 +71,11 @@
/* Posix */
/* ------------------------------------------------- */
-void Posix_IO_setbin (__attribute__ ((unused)) Fd fd) {
+void Posix_IO_setbin (__attribute__ ((unused)) C_Fd_t fd) {
die("Posix_IO_setbin not implemented");
}
-void Posix_IO_settext (__attribute__ ((unused)) Fd fd) {
+void Posix_IO_settext (__attribute__ ((unused)) C_Fd_t fd) {
die("Posix_IO_settext not implemented");
}
@@ -83,7 +83,7 @@
/* Process */
/* ------------------------------------------------- */
-Pid MLton_Process_cwait (__attribute__ ((unused)) Pid pid,
- __attribute__ ((unused)) Pointer status) {
+C_Errno_t(C_PId_t) MLton_Process_cwait (__attribute__ ((unused)) C_PId_t pid,
+ __attribute__ ((unused)) Ref(C_Int_t) status) {
die("MLton_Process_cwait not implemented");
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.h 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.h 2006-01-26 03:06:35 UTC (rev 4307)
@@ -24,7 +24,6 @@
#define HAS_FEROUND TRUE
#define HAS_FPCLASSIFY TRUE
-#define HAS_PTRACE TRUE
#define HAS_REMAP TRUE
#define HAS_SIGALTSTACK TRUE
#define HAS_SIGNBIT TRUE
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.h 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.h 2006-01-26 03:06:35 UTC (rev 4307)
@@ -19,7 +19,6 @@
// classifies subnormals as normals. So, we disable it here, which causes the
// runtime to use our own version.
#define HAS_FPCLASSIFY FALSE
-#define HAS_PTRACE FALSE
#define HAS_REMAP FALSE
#define HAS_SIGALTSTACK FALSE
#define HAS_SIGNBIT TRUE
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.h 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.h 2006-01-26 03:06:35 UTC (rev 4307)
@@ -22,7 +22,6 @@
#define HAS_FEROUND FALSE
#define HAS_FPCLASSIFY TRUE
-#define HAS_PTRACE FALSE
#define HAS_REMAP FALSE
#define HAS_SIGALTSTACK TRUE
#define HAS_SIGNBIT TRUE
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.h 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.h 2006-01-26 03:06:35 UTC (rev 4307)
@@ -21,7 +21,6 @@
#define HAS_FEROUND FALSE
#define HAS_FPCLASSIFY FALSE
-#define HAS_PTRACE FALSE
#define HAS_REMAP FALSE
#define HAS_SIGALTSTACK TRUE
#define HAS_SIGNBIT FALSE
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/solaris.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/solaris.h 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/solaris.h 2006-01-26 03:06:35 UTC (rev 4307)
@@ -34,7 +34,6 @@
#define HAS_FEROUND TRUE
#define HAS_FPCLASSIFY FALSE
#define HAS_FPCLASSIFY64 TRUE
-#define HAS_PTRACE TRUE
#define HAS_REMAP FALSE
#define HAS_SIGALTSTACK TRUE
#define HAS_SIGNBIT FALSE
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/windows.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/windows.c 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/windows.c 2006-01-26 03:06:35 UTC (rev 4307)
@@ -124,8 +124,9 @@
die ("VirtualFree release failed");
}
-Pid Windows_Process_create (NullString cmds, NullString args, NullString envs,
- Fd in, Fd out, Fd err) {
+C_Errno_t(C_PId_t)
+Windows_Process_create (NullString8_t cmds, NullString8_t args, NullString8_t envs,
+ C_Fd_t in, C_Fd_t out, C_Fd_t err) {
char *cmd;
char *arg;
char *env;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform.h 2006-01-25 03:19:07 UTC (rev 4306)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform.h 2006-01-26 03:06:35 UTC (rev 4307)
@@ -49,10 +49,6 @@
#error HAS_FEROUND not defined
#endif
-#ifndef HAS_PTRACE
-#error HAS_PTRACE not defined
-#endif
-
#ifndef HAS_REMAP
#error HAS_REMAP not defined
#endif
@@ -235,14 +231,6 @@
extern Bool MLton_Platform_CygwinUseMmap;
-/* ---------------------------------- */
-/* MLton.Process */
-/* ---------------------------------- */
-
-Pid MLton_Process_cwait (Pid p, Pointer s);
-Int MLton_Process_spawne (Pointer p, Pointer a, Pointer e);
-Int MLton_Process_spawnp (Pointer p, Pointer a);
-
/* ------------------------------------------------- */
/* PackReal */
/* ------------------------------------------------- */
@@ -257,350 +245,14 @@
void PackReal64_updateRev (Pointer a, Int offset, Real64 r);
/* ------------------------------------------------- */
-/* Posix */
-/* ------------------------------------------------- */
-
-/* ---------------------------------- */
-/* Posix.FileSys */
-/* ---------------------------------- */
-
-#define Posix_FileSys_S_ifsock S_IFSOCK
-#define Posix_FileSys_S_iflnk S_IFLNK
-#define Posix_FileSys_S_ifreg S_IFREG
-#define Posix_FileSys_S_ifblk S_IFBLK
-#define Posix_FileSys_S_ifdir S_IFDIR
-#define Posix_FileSys_S_ifchr S_IFCHR
-#define Posix_FileSys_S_ififo S_IFIFO
-
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
-
-#ifndef O_TEXT
-#define O_TEXT 0
-#endif
-
-#define Posix_FileSys_O_append O_APPEND
-#define Posix_FileSys_O_binary O_BINARY
-#define Posix_FileSys_O_creat O_CREAT
-#define Posix_FileSys_O_excl O_EXCL
-#define Posix_FileSys_O_noctty O_NOCTTY
-#define Posix_FileSys_O_nonblock O_NONBLOCK
-#if (defined (O_SYNC))
-#define Posix_FileSys_O_sync O_SYNC
-#else
-#define Posix_FileSys_O_sync 0
-#endif
-#define Posix_FileSys_O_text O_TEXT
-#define Posix_FileSys_O_trunc O_TRUNC
-#define Posix_FileSys_o_rdonly O_RDONLY
-#define Posix_FileSys_o_wronly O_WRONLY
-#define Posix_FileSys_o_rdwr O_RDWR
-#define Posix_FileSys_S_irwxu S_IRWXU
-#define Posix_FileSys_S_irusr S_IRUSR
-#define Posix_FileSys_S_iwusr S_IWUSR
-#define Posix_FileSys_S_ixusr S_IXUSR
-#define Posix_FileSys_S_irwxg S_IRWXG
-#define Posix_FileSys_S_irgrp S_IRGRP
-#define Posix_FileSys_S_iwgrp S_IWGRP
-#define Posix_FileSys_S_ixgrp S_IXGRP
-#define Posix_FileSys_S_irwxo S_IRWXO
-#define Posix_FileSys_S_iroth S_IROTH
-#define Posix_FileSys_S_iwoth S_IWOTH
-#define Posix_FileSys_S_ixoth S_IXOTH
-#define Posix_FileSys_S_isuid S_ISUID
-#define Posix_FileSys_S_isgid S_ISGID
-
-#define Posix_FileSys_R_OK R_OK
-#define Posix_FileSys_W_OK W_OK
-#define Posix_FileSys_X_OK X_OK
-#define Posix_FileSys_F_OK F_OK
-
-/* used by pathconf and fpathconf */
-#define Posix_FileSys_CHOWN_RESTRICTED _PC_CHOWN_RESTRICTED
-#define Posix_FileSys_LINK_MAX _PC_LINK_MAX
-#define Posix_FileSys_MAX_CANON _PC_MAX_CANON
-#define Posix_FileSys_MAX_INPUT _PC_MAX_INPUT
-#define Posix_FileSys_NAME_MAX _PC_NAME_MAX
-#define Posix_FileSys_NO_TRUNC _PC_NO_TRUNC
-#define Posix_FileSys_PATH_MAX _PC_PATH_MAX
-#define Posix_FileSys_PIPE_BUF _PC_PIPE_BUF
-#define Posix_FileSys_VDISABLE _PC_VDISABLE
-
-#if (defined (_PC_SYNC_IO))
-#define Posix_FileSys_SYNC_IO _PC_SYNC_IO
-#else
-#define Posix_FileSys_SYNC_IO 0
-#endif
-
-#if (defined (_PC_ASYNC_IO))
-#define Posix_FileSys_ASYNC_IO _PC_ASYNC_IO
-#else
-#define Posix_FileSys_ASYNC_IO 0
-#define Posix_FileSys_PRIO_IO 0
-#endif
-
-#if (defined (_PC_PRIO_IO))
-#define Posix_FileSys_PRIO_IO _PC_PRIO_IO
-#else
-#define Posix_FileSys_PRIO_IO 0
-#endif
-
-void Posix_FileSys_Utimbuf_setActime (Int x);
-void Posix_FileSys_Utimbuf_setModTime (Int x);
-Int Posix_FileSys_Utimbuf_utime (Pointer s);
-
-Int Posix_FileSys_access (Pointer f, Word w);
-Int Posix_FileSys_chdir(Pointer p);
-Int Posix_FileSys_chmod (Pointer p, Mode m);
-Int Posix_FileSys_chown (Pointer p, Uid u, Gid g);
-Int Posix_FileSys_fchmod (Fd f, Mode m);
-Int Posix_FileSys_fchown (Fd f, Uid u, Gid g);
-Int Posix_FileSys_fpathconf (Fd f, Int n);
-Int Posix_FileSys_ftruncate (Fd f, Position n);
-Cstring Posix_FileSys_getcwd (Pointer buf, Size n);
-Int Posix_FileSys_link (Pointer p1, Pointer p2);
-Int Posix_FileSys_mkdir (Pointer p, Word w);
-Int Posix_FileSys_mkfifo (Pointer p, Word w);
-Int Posix_FileSys_open (Pointer p, Word w, Mode m);
-Int Posix_FileSys_pathconf (Pointer p, Int n);
-Int Posix_FileSys_readlink (Pointer p, Pointer b, Int);
-Int Posix_FileSys_rename (Pointer p1, Pointer p2);
-Int Posix_FileSys_rmdir (Pointer p);
-Int Posix_FileSys_symlink (Pointer p1, Pointer p2);
-Word Posix_FileSys_umask (Word w);
-Word Posix_FileSys_unlink (Pointer p);
-
-/* ---------------------------------- */
-/* Posix.IO */
-/* ---------------------------------- */
-
-#define Posix_IO_F_DUPFD F_DUPFD
-#define Posix_IO_F_GETFD F_GETFD
-#define Posix_IO_F_SETFD F_SETFD
-#define Posix_IO_F_GETFL F_GETFL
-#define Posix_IO_F_SETFL F_SETFL
-#define Posix_IO_F_GETLK F_GETLK
-#define Posix_IO_F_SETLK F_SETLK
-#define Posix_IO_F_RDLCK F_RDLCK
-#define Posix_IO_F_WRLCK F_WRLCK
-#define Posix_IO_F_UNLCK F_UNLCK
-#define Posix_IO_F_SETLKW F_SETLKW
-#define Posix_IO_F_GETOWN F_GETOWN
-#define Posix_IO_F_SETOWN F_SETOWN
-#define Posix_IO_O_ACCMODE O_ACCMODE
-#define Posix_IO_SEEK_SET SEEK_SET
-#define Posix_IO_SEEK_CUR SEEK_CUR
-#define Posix_IO_SEEK_END SEEK_END
-#define Posix_IO_FD_cloexec FD_CLOEXEC
-
-Int Posix_IO_FLock_fcntl (Fd f, Int cmd);
-Int Posix_IO_FLock_type (void);
-Int Posix_IO_FLock_whence (void);
-Position Posix_IO_FLock_start (void);
-Position Posix_IO_FLock_len (void);
-Int Posix_IO_FLock_pid (void);
-void Posix_IO_FLock_setType (Int x);
-void Posix_IO_FLock_setWhence (Int x);
-void Posix_IO_FLock_setStart (Position x);
-void Posix_IO_FLock_setLen (Position x);
-void Posix_IO_FLock_setPid (Int x);
-
-Int Posix_IO_close (Fd f);
-Fd Posix_IO_dup (Fd f);
-Fd Posix_IO_dup2 (Fd f1, Fd f2);
-Int Posix_IO_fcntl2 (Fd f, Int i);
-Int Posix_IO_fcntl3 (Fd f, Int i, Int j);
-Int Posix_IO_fsync (Fd f);
-Position Posix_IO_lseek (Fd f, Position i, Int j);
-Int Posix_IO_pipe (Pointer fds);
-Ssize Posix_IO_read (Fd fd, Pointer b, Int i, Size s);
-void Posix_IO_setbin (Fd fd);
-void Posix_IO_settext (Fd fd);
-Ssize Posix_IO_write (Fd fd, Pointer b, Int i, Size s);
-
-/* ---------------------------------- */
-/* Posix.ProcEnv */
-/* ---------------------------------- */
-
-extern CstringArray Posix_ProcEnv_environ;
-
-/* used by sysconf. */
-#define Posix_ProcEnv_2_FORT_DEV _SC_2_FORT_DEV
-#define Posix_ProcEnv_2_FORT_RUN _SC_2_FORT_RUN
-#define Posix_ProcEnv_2_SW_DEV _SC_2_SW_DEV
-#define Posix_ProcEnv_2_VERSION _SC_2_VERSION
-#define Posix_ProcEnv_ARG_MAX _SC_ARG_MAX
-#define Posix_ProcEnv_BC_BASE_MAX _SC_BC_BASE_MAX
-#define Posix_ProcEnv_BC_DIM_MAX _SC_BC_DIM_MAX
-#define Posix_ProcEnv_BC_SCALE_MAX _SC_BC_SCALE_MAX
-#define Posix_ProcEnv_BC_STRING_MAX _SC_BC_STRING_MAX
-#define Posix_ProcEnv_CHILD_MAX _SC_CHILD_MAX
-#define Posix_ProcEnv_CLK_TCK _SC_CLK_TCK
-#define Posix_ProcEnv_COLL_WEIGHTS_MAX _SC_COLL_WEIGHTS_MAX
-#define Posix_ProcEnv_EXPR_NEST_MAX _SC_EXPR_NEST_MAX
-#define Posix_ProcEnv_JOB_CONTROL _SC_JOB_CONTROL
-#define Posix_ProcEnv_LINE_MAX _SC_LINE_MAX
-#define Posix_ProcEnv_NGROUPS_MAX _SC_NGROUPS_MAX
-#define Posix_ProcEnv_OPEN_MAX _SC_OPEN_MAX
-#define Posix_ProcEnv_RE_DUP_MAX _SC_RE_DUP_MAX
-#define Posix_ProcEnv_SAVED_IDS _SC_SAVED_IDS
-#define Posix_ProcEnv_STREAM_MAX _SC_STREAM_MAX
-#define Posix_ProcEnv_TZNAME_MAX _SC_TZNAME_MAX
-#define Posix_ProcEnv_VERSION _SC_VERSION
-
-enum {
- Posix_ProcEnv_numgroups = 100,
-};
-
-Pid Posix_ProcEnv_getpid (void);
-Pid Posix_ProcEnv_getppid (void);
-Uid Posix_ProcEnv_getuid (void);
-Uid Posix_ProcEnv_geteuid (void);
-Gid Posix_ProcEnv_getgid (void);
-Gid Posix_ProcEnv_getegid (void);
-Int Posix_ProcEnv_setenv (Pointer s, Pointer v);
-Int Posix_ProcEnv_setuid (Uid u);
-Int Posix_ProcEnv_setgid (Gid g);
-Int Posix_ProcEnv_getgroups (Pointer groups);
-Int Posix_ProcEnv_setgroups (Pointer groups);
-Cstring Posix_ProcEnv_getlogin (void);
-Pid Posix_ProcEnv_getpgrp (void);
-Pid Posix_ProcEnv_setsid (void);
-Int Posix_ProcEnv_setpgid (Pid p, Gid g);
-
-Int Posix_ProcEnv_Uname_uname (void);
-Cstring Posix_ProcEnv_Uname_sysname (void);
-Cstring Posix_ProcEnv_Uname_nodename (void);
-Cstring Posix_ProcEnv_Uname_release (void);
-Cstring Posix_ProcEnv_Uname_version (void);
-Cstring Posix_ProcEnv_Uname_machine (void);
-
-Int Posix_ProcEnv_Tms_utime (void);
-Int Posix_ProcEnv_Tms_stime (void);
-Int Posix_ProcEnv_Tms_cutime (void);
-Int Posix_ProcEnv_Tms_cstime (void);
-
-Cstring Posix_ProcEnv_ctermid (void);
-Cstring Posix_ProcEnv_getenv (Pointer s);
-Bool Posix_ProcEnv_isatty (Fd f);
-Int Posix_ProcEnv_sysconf (Int i);
-Int Posix_ProcEnv_times (void);
-Cstring Posix_ProcEnv_ttyname (Fd f);
-
-/* ---------------------------------- */
-/* Posix.Process */
-/* ---------------------------------- */
-
-#define Posix_Process_wnohang WNOHANG
-#define Posix_Process_W_untraced WUNTRACED
-
-#define Posix_Signal_abrt SIGABRT
-#define Posix_Signal_alrm SIGALRM
-#define Posix_Signal_bus SIGBUS
-#define Posix_Signal_chld SIGCHLD
-#define Posix_Signal_cont SIGCONT
-#define Posix_Signal_fpe SIGFPE
-#define Posix_Signal_hup SIGHUP
-#define Posix_Signal_ill SIGILL
-#define Posix_Signal_int SIGINT
-#define Posix_Signal_kill SIGKILL
-#define Posix_Signal_pipe SIGPIPE
-#define Posix_Signal_prof SIGPROF
-#define Posix_Signal_quit SIGQUIT
-#define Posix_Signal_segv SIGSEGV
-#define Posix_Signal_stop SIGSTOP
-#define Posix_Signal_term SIGTERM
-#define Posix_Signal_tstp SIGTSTP
-#define Posix_Signal_ttin SIGTTIN
-#define Posix_Signal_ttou SIGTTOU
-#define Posix_Signal_usr1 SIGUSR1
-#define Posix_Signal_usr2 SIGUSR2
-#define Posix_Signal_vtalrm SIGVTALRM
-
-Int Posix_Process_alarm (Int i);
-Int Posix_Process_exece (Pointer path, Pointer args, Pointer env);
-Int Posix_Process_execp (Pointer file, Pointer args);
-void Posix_Process_exit (Int i) __attribute__ ((noreturn));
-Pid Posix_Process_fork (void);
-Int Posix_Process_kill (Pid p, Signal s);
-Int Posix_Process_nanosleep (Pointer sec, Pointer nsec);
-Int Posix_Process_pause (void);
-Int Posix_Process_sleep (Int i);
-int Posix_Process_system (const char* cmd);
-Pid Posix_Process_waitpid (Pid p, Pointer s, Int i);
-Bool Posix_Process_ifExited (Status s);
-Int Posix_Process_exitStatus (Status s);
-Bool Posix_Process_ifSignaled (Status s);
-Signal Posix_Process_termSig (Status s);
-Bool Posix_Process_ifStopped (Status s);
-Signal Posix_Process_stopSig (Status s);
-
-/* ---------------------------------- */
-/* Posix.Signal */
-/* ---------------------------------- */
-
-#define Posix_Signal_block SIG_BLOCK
-#if (defined (NSIG))
-#define Posix_Signal_numSignals NSIG
-#elif (defined (_NSIG))
-#define Posix_Signal_numSignals _NSIG
-#else
-#error Posix_Signal_numSignals not defined
-#endif
-#define Posix_Signal_setmask SIG_SETMASK
-#define Posix_Signal_unblock SIG_UNBLOCK
-Int Posix_Signal_default (Int signum);
-bool Posix_Signal_isGCPending (void);
-Bool Posix_Signal_isPending (Int signum);
-Int Posix_Signal_handle (Int signum);
-void Posix_Signal_handleGC (void);
-Int Posix_Signal_ignore (Int signum);
-Int Posix_Signal_isDefault (Int signum, Bool *isDef);
-void Posix_Signal_resetPending (void);
-
-Int Posix_Signal_sigaddset (Int signum);
-Int Posix_Signal_sigdelset (Int signum);
-Int Posix_Signal_sigemptyset (void);
-Int Posix_Signal_sigfillset (void);
-Int Posix_Signal_sigismember (Int signum);
-Int Posix_Signal_sigprocmask (Int how);
-void Posix_Signal_suspend (void);
-
-/* ---------------------------------- */
-/* Posix.SysDB */
-/* ---------------------------------- */
-
-Cstring Posix_SysDB_Passwd_name (void);
-Uid Posix_SysDB_Passwd_uid (void);
-Gid Posix_SysDB_Passwd_gid (void);
-Cstring Posix_SysDB_Passwd_dir (void);
-Cstring Posix_SysDB_Passwd_shell (void);
-Bool Posix_SysDB_getpwnam (Pointer p);
-Bool Posix_SysDB_getpwuid (Uid u);
-Bool Posix_SysDB_getgrgid (Gid g);
-Bool Posix_SysDB_getgrnam (Pointer s);
-Cstring Posix_SysDB_Group_name (void);
-Gid Posix_SysDB_Group_gid (void);
-CstringArray Posix_SysDB_Group_mem (void);
-
-/* ------------------------------------------------- */
-/* Ptrace */
-/* ------------------------------------------------- */
-
-Int Ptrace_ptrace2 (Int request, Int pid);
-/* data is a word ref */
-Int Ptrace_ptrace4 (Int request, Int pid, Word addr, Pointer data);
-
-/* ------------------------------------------------- */
/* Real */
/* ------------------------------------------------- */
Real64 Real64_modf (Real64 x, Real64 *exp);
Real32 Real32_modf (Real32 x, Real32 *exp);
Real64 Real64_frexp (Real64 x, Int *exp);
-Cstring Real64_gdtoa (double d, int mode, int ndig, int *decpt);
-Cstring Real32_gdtoa (float f, int mode, int ndig, int *decpt);
+C_String_t Real64_gdtoa (double d, int mode, int ndig, int *decpt);
+C_String_t Real32_gdtoa (float f, int mode, int ndig, int *decpt);
Int Real32_class (Real32 f);
Int Real64_class (Real64 d);
Real32 Real32_strto (Pointer s);
@@ -631,7 +283,6 @@
/* Windows */
/* ------------------------------------------------- */
-Int Windows_terminate (Pid p, Int s);
/* ------------------------------------------------- */
/* Word{8,16,32,64} */