summaryrefslogtreecommitdiffstats
path: root/otherlibs/unix
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/unix')
-rw-r--r--otherlibs/unix/accept.c5
-rw-r--r--otherlibs/unix/access.c3
-rw-r--r--otherlibs/unix/addrofstr.c5
-rw-r--r--otherlibs/unix/bind.c6
-rw-r--r--otherlibs/unix/chdir.c3
-rw-r--r--otherlibs/unix/chmod.c3
-rw-r--r--otherlibs/unix/chown.c3
-rw-r--r--otherlibs/unix/chroot.c3
-rw-r--r--otherlibs/unix/close.c3
-rw-r--r--otherlibs/unix/closedir.c3
-rw-r--r--otherlibs/unix/connect.c6
-rw-r--r--otherlibs/unix/cst2constr.c6
-rw-r--r--otherlibs/unix/cstringv.c3
-rw-r--r--otherlibs/unix/dup.c3
-rw-r--r--otherlibs/unix/dup2.c9
-rw-r--r--otherlibs/unix/envir.c2
-rw-r--r--otherlibs/unix/errmsg.c8
-rw-r--r--otherlibs/unix/execv.c3
-rw-r--r--otherlibs/unix/execve.c3
-rw-r--r--otherlibs/unix/execvp.c6
-rw-r--r--otherlibs/unix/exit.c3
-rw-r--r--otherlibs/unix/fchmod.c6
-rw-r--r--otherlibs/unix/fchown.c6
-rw-r--r--otherlibs/unix/fcntl.c16
-rw-r--r--otherlibs/unix/fork.c3
-rw-r--r--otherlibs/unix/ftruncate.c6
-rw-r--r--otherlibs/unix/getcwd.c7
-rw-r--r--otherlibs/unix/getegid.c2
-rw-r--r--otherlibs/unix/geteuid.c2
-rw-r--r--otherlibs/unix/getgid.c2
-rw-r--r--otherlibs/unix/getgr.c9
-rw-r--r--otherlibs/unix/getgroups.c5
-rw-r--r--otherlibs/unix/gethost.c16
-rw-r--r--otherlibs/unix/gethostname.c7
-rw-r--r--otherlibs/unix/getlogin.c4
-rw-r--r--otherlibs/unix/getpeername.c6
-rw-r--r--otherlibs/unix/getpid.c2
-rw-r--r--otherlibs/unix/getppid.c2
-rw-r--r--otherlibs/unix/getproto.c13
-rw-r--r--otherlibs/unix/getpw.c9
-rw-r--r--otherlibs/unix/getserv.c13
-rw-r--r--otherlibs/unix/getsockname.c6
-rw-r--r--otherlibs/unix/gettimeofday.c5
-rw-r--r--otherlibs/unix/getuid.c2
-rw-r--r--otherlibs/unix/gmtime.c14
-rw-r--r--otherlibs/unix/itimer.c26
-rw-r--r--otherlibs/unix/kill.c3
-rw-r--r--otherlibs/unix/link.c3
-rw-r--r--otherlibs/unix/listen.c6
-rw-r--r--otherlibs/unix/lockf.c9
-rw-r--r--otherlibs/unix/lseek.c3
-rw-r--r--otherlibs/unix/mkdir.c3
-rw-r--r--otherlibs/unix/mkfifo.c8
-rw-r--r--otherlibs/unix/nice.c6
-rw-r--r--otherlibs/unix/open.c3
-rw-r--r--otherlibs/unix/opendir.c3
-rw-r--r--otherlibs/unix/pause.c2
-rw-r--r--otherlibs/unix/pipe.c2
-rw-r--r--otherlibs/unix/read.c3
-rw-r--r--otherlibs/unix/readdir.c3
-rw-r--r--otherlibs/unix/readlink.c6
-rw-r--r--otherlibs/unix/rename.c3
-rw-r--r--otherlibs/unix/rewinddir.c6
-rw-r--r--otherlibs/unix/rmdir.c3
-rw-r--r--otherlibs/unix/select.c13
-rw-r--r--otherlibs/unix/sendrecv.c31
-rw-r--r--otherlibs/unix/setgid.c3
-rw-r--r--otherlibs/unix/setsid.c3
-rw-r--r--otherlibs/unix/setuid.c3
-rw-r--r--otherlibs/unix/shutdown.c6
-rw-r--r--otherlibs/unix/sleep.c3
-rw-r--r--otherlibs/unix/socket.c6
-rw-r--r--otherlibs/unix/socketaddr.c8
-rw-r--r--otherlibs/unix/socketaddr.h6
-rw-r--r--otherlibs/unix/socketpair.c6
-rw-r--r--otherlibs/unix/sockopt.c13
-rw-r--r--otherlibs/unix/stat.c12
-rw-r--r--otherlibs/unix/strofaddr.c5
-rw-r--r--otherlibs/unix/symlink.c6
-rw-r--r--otherlibs/unix/termios.c47
-rw-r--r--otherlibs/unix/time.c7
-rw-r--r--otherlibs/unix/times.c4
-rw-r--r--otherlibs/unix/truncate.c6
-rw-r--r--otherlibs/unix/umask.c3
-rw-r--r--otherlibs/unix/unixsupport.c9
-rw-r--r--otherlibs/unix/unixsupport.h4
-rw-r--r--otherlibs/unix/unlink.c3
-rw-r--r--otherlibs/unix/utimes.c9
-rw-r--r--otherlibs/unix/wait.c11
-rw-r--r--otherlibs/unix/write.c3
90 files changed, 246 insertions, 337 deletions
diff --git a/otherlibs/unix/accept.c b/otherlibs/unix/accept.c
index 228059d25..8d2c2fd5b 100644
--- a/otherlibs/unix/accept.c
+++ b/otherlibs/unix/accept.c
@@ -21,8 +21,7 @@
#include "socketaddr.h"
-value unix_accept(sock) /* ML */
- value sock;
+value unix_accept(value sock) /* ML */
{
int retcode;
value res;
@@ -44,6 +43,6 @@ value unix_accept(sock) /* ML */
#else
-value unix_accept() { invalid_argument("accept not implemented"); }
+value unix_accept(value sock) { invalid_argument("accept not implemented"); }
#endif
diff --git a/otherlibs/unix/access.c b/otherlibs/unix/access.c
index 605adda2f..d53d83eb3 100644
--- a/otherlibs/unix/access.c
+++ b/otherlibs/unix/access.c
@@ -38,8 +38,7 @@ static int access_permission_table[] = {
R_OK, W_OK, X_OK, F_OK
};
-value unix_access(path, perms) /* ML */
- value path, perms;
+value unix_access(value path, value perms) /* ML */
{
int ret;
ret = access(String_val(path),
diff --git a/otherlibs/unix/addrofstr.c b/otherlibs/unix/addrofstr.c
index 4efdb0637..1af25f475 100644
--- a/otherlibs/unix/addrofstr.c
+++ b/otherlibs/unix/addrofstr.c
@@ -19,8 +19,7 @@
#include "socketaddr.h"
-value unix_inet_addr_of_string(s) /* ML */
- value s;
+value unix_inet_addr_of_string(value s) /* ML */
{
unsigned int address;
address = inet_addr(String_val(s));
@@ -30,7 +29,7 @@ value unix_inet_addr_of_string(s) /* ML */
#else
-value unix_inet_addr_of_string()
+value unix_inet_addr_of_string(value s)
{ invalid_argument("inet_addr_of_string not implemented"); }
#endif
diff --git a/otherlibs/unix/bind.c b/otherlibs/unix/bind.c
index 11bbec0aa..74b5b5bdd 100644
--- a/otherlibs/unix/bind.c
+++ b/otherlibs/unix/bind.c
@@ -18,8 +18,7 @@
#include "socketaddr.h"
-value unix_bind(socket, address) /* ML */
- value socket, address;
+value unix_bind(value socket, value address) /* ML */
{
int ret;
get_sockaddr(address);
@@ -30,6 +29,7 @@ value unix_bind(socket, address) /* ML */
#else
-value unix_bind() { invalid_argument("bind not implemented"); }
+value unix_bind(value socket, value address)
+{ invalid_argument("bind not implemented"); }
#endif
diff --git a/otherlibs/unix/chdir.c b/otherlibs/unix/chdir.c
index ccd502347..7dc1ba41d 100644
--- a/otherlibs/unix/chdir.c
+++ b/otherlibs/unix/chdir.c
@@ -14,8 +14,7 @@
#include <mlvalues.h>
#include "unixsupport.h"
-value unix_chdir(path) /* ML */
- value path;
+value unix_chdir(value path) /* ML */
{
int ret;
ret = chdir(String_val(path));
diff --git a/otherlibs/unix/chmod.c b/otherlibs/unix/chmod.c
index 557e20a60..c73c8892d 100644
--- a/otherlibs/unix/chmod.c
+++ b/otherlibs/unix/chmod.c
@@ -16,8 +16,7 @@
#include <mlvalues.h>
#include "unixsupport.h"
-value unix_chmod(path, perm) /* ML */
- value path, perm;
+value unix_chmod(value path, value perm) /* ML */
{
int ret;
ret = chmod(String_val(path), Int_val(perm));
diff --git a/otherlibs/unix/chown.c b/otherlibs/unix/chown.c
index 1457c325c..9023bc079 100644
--- a/otherlibs/unix/chown.c
+++ b/otherlibs/unix/chown.c
@@ -14,8 +14,7 @@
#include <mlvalues.h>
#include "unixsupport.h"
-value unix_chown(path, uid, gid) /* ML */
- value path, uid, gid;
+value unix_chown(value path, value uid, value gid) /* ML */
{
int ret;
ret = chown(String_val(path), Int_val(uid), Int_val(gid));
diff --git a/otherlibs/unix/chroot.c b/otherlibs/unix/chroot.c
index 864690367..444a56dc1 100644
--- a/otherlibs/unix/chroot.c
+++ b/otherlibs/unix/chroot.c
@@ -14,8 +14,7 @@
#include <mlvalues.h>
#include "unixsupport.h"
-value unix_chroot(path) /* ML */
- value path;
+value unix_chroot(value path) /* ML */
{
int ret;
ret = chroot(String_val(path));
diff --git a/otherlibs/unix/close.c b/otherlibs/unix/close.c
index e750c0dc0..eb4d9d87b 100644
--- a/otherlibs/unix/close.c
+++ b/otherlibs/unix/close.c
@@ -14,8 +14,7 @@
#include <mlvalues.h>
#include "unixsupport.h"
-value unix_close(fd) /* ML */
- value fd;
+value unix_close(value fd) /* ML */
{
if (close(Int_val(fd)) == -1) uerror("close", Nothing);
return Val_unit;
diff --git a/otherlibs/unix/closedir.c b/otherlibs/unix/closedir.c
index c0feae1f9..9a722b445 100644
--- a/otherlibs/unix/closedir.c
+++ b/otherlibs/unix/closedir.c
@@ -20,8 +20,7 @@
#include <sys/dir.h>
#endif
-value unix_closedir(d) /* ML */
- value d;
+value unix_closedir(value d) /* ML */
{
closedir((DIR *) d);
return Val_unit;
diff --git a/otherlibs/unix/connect.c b/otherlibs/unix/connect.c
index bc2012d86..74eb7188f 100644
--- a/otherlibs/unix/connect.c
+++ b/otherlibs/unix/connect.c
@@ -19,8 +19,7 @@
#include "socketaddr.h"
-value unix_connect(socket, address) /* ML */
- value socket, address;
+value unix_connect(value socket, value address) /* ML */
{
int retcode;
get_sockaddr(address);
@@ -33,6 +32,7 @@ value unix_connect(socket, address) /* ML */
#else
-value unix_connect() { invalid_argument("connect not implemented"); }
+value unix_connect(value socket, value address)
+{ invalid_argument("connect not implemented"); }
#endif
diff --git a/otherlibs/unix/cst2constr.c b/otherlibs/unix/cst2constr.c
index 8ce4fb7d4..59df66a93 100644
--- a/otherlibs/unix/cst2constr.c
+++ b/otherlibs/unix/cst2constr.c
@@ -15,11 +15,7 @@
#include <fail.h>
#include "cst2constr.h"
-value cst_to_constr(n, tbl, size, deflt)
- int n;
- int * tbl;
- int size;
- int deflt;
+value cst_to_constr(int n, int *tbl, int size, int deflt)
{
int i;
for (i = 0; i < size; i++)
diff --git a/otherlibs/unix/cstringv.c b/otherlibs/unix/cstringv.c
index b7a8619e4..a85c8a3e2 100644
--- a/otherlibs/unix/cstringv.c
+++ b/otherlibs/unix/cstringv.c
@@ -15,8 +15,7 @@
#include <memory.h>
#include "unixsupport.h"
-char ** cstringvect(arg)
- value arg;
+char ** cstringvect(value arg)
{
char ** res;
mlsize_t size, i;
diff --git a/otherlibs/unix/dup.c b/otherlibs/unix/dup.c
index c3c8d881c..dfb9ec897 100644
--- a/otherlibs/unix/dup.c
+++ b/otherlibs/unix/dup.c
@@ -14,8 +14,7 @@
#include <mlvalues.h>
#include "unixsupport.h"
-value unix_dup(fd) /* ML */
- value fd;
+value unix_dup(value fd) /* ML */
{
int ret;
ret = dup(Int_val(fd));
diff --git a/otherlibs/unix/dup2.c b/otherlibs/unix/dup2.c
index 242885778..a46c2b8d2 100644
--- a/otherlibs/unix/dup2.c
+++ b/otherlibs/unix/dup2.c
@@ -16,8 +16,7 @@
#ifdef HAS_DUP2
-value unix_dup2(fd1, fd2) /* ML */
- value fd1, fd2;
+value unix_dup2(value fd1, value fd2) /* ML */
{
if (dup2(Int_val(fd1), Int_val(fd2)) == -1) uerror("dup2", Nothing);
return Val_unit;
@@ -25,8 +24,7 @@ value unix_dup2(fd1, fd2) /* ML */
#else
-static int do_dup2(fd1, fd2)
- int fd1, fd2;
+static int do_dup2(int fd1, int fd2)
{
int fd;
int res;
@@ -39,8 +37,7 @@ static int do_dup2(fd1, fd2)
return res;
}
-value unix_dup2(fd1, fd2) /* ML */
- value fd1, fd2;
+value unix_dup2(value fd1, value fd2) /* ML */
{
close(Int_val(fd2));
if (do_dup2(Int_val(fd1), Int_val(fd2)) == -1) uerror("dup2", Nothing);
diff --git a/otherlibs/unix/envir.c b/otherlibs/unix/envir.c
index 24e57ce4d..a45ecc00c 100644
--- a/otherlibs/unix/envir.c
+++ b/otherlibs/unix/envir.c
@@ -16,7 +16,7 @@
extern char ** environ;
-value unix_environment()
+value unix_environment(void)
{
return copy_string_array(environ);
}
diff --git a/otherlibs/unix/errmsg.c b/otherlibs/unix/errmsg.c
index b10a080fb..c802bc3f4 100644
--- a/otherlibs/unix/errmsg.c
+++ b/otherlibs/unix/errmsg.c
@@ -19,10 +19,9 @@ extern int error_table[];
#ifdef HAS_STRERROR
-extern char * strerror();
+extern char * strerror(int);
-value unix_error_message(err)
- value err;
+value unix_error_message(value err)
{
int errnum;
errnum = error_table[Int_val(err)];
@@ -34,8 +33,7 @@ value unix_error_message(err)
extern int sys_nerr;
extern char *sys_errlist[];
-value unix_error_message(err)
- value err;
+value unix_error_message(value err)
{
int errnum;
errnum = error_table[Int_val(err)];
diff --git a/otherlibs/unix/execv.c b/otherlibs/unix/execv.c
index 755b2406e..5acb9bd41 100644
--- a/otherlibs/unix/execv.c
+++ b/otherlibs/unix/execv.c
@@ -17,8 +17,7 @@
extern char ** cstringvect();
-value unix_execv(path, args) /* ML */
- value path, args;
+value unix_execv(value path, value args) /* ML */
{
char ** argv;
argv = cstringvect(args);
diff --git a/otherlibs/unix/execve.c b/otherlibs/unix/execve.c
index 52fc28f19..c02a19a24 100644
--- a/otherlibs/unix/execve.c
+++ b/otherlibs/unix/execve.c
@@ -17,8 +17,7 @@
extern char ** cstringvect();
-value unix_execve(path, args, env) /* ML */
- value path, args, env;
+value unix_execve(value path, value args, value env) /* ML */
{
char ** argv;
char ** envp;
diff --git a/otherlibs/unix/execvp.c b/otherlibs/unix/execvp.c
index 870075bd9..6a8298427 100644
--- a/otherlibs/unix/execvp.c
+++ b/otherlibs/unix/execvp.c
@@ -18,8 +18,7 @@
extern char ** cstringvect();
extern char ** environ;
-value unix_execvp(path, args) /* ML */
- value path, args;
+value unix_execvp(value path, value args) /* ML */
{
char ** argv;
argv = cstringvect(args);
@@ -30,8 +29,7 @@ value unix_execvp(path, args) /* ML */
/* from smart compilers */
}
-value unix_execvpe(path, args, env) /* ML */
- value path, args, env;
+value unix_execvpe(value path, value args, value env) /* ML */
{
char ** argv;
char ** saved_environ;
diff --git a/otherlibs/unix/exit.c b/otherlibs/unix/exit.c
index 8317ddbcd..aeb82c01f 100644
--- a/otherlibs/unix/exit.c
+++ b/otherlibs/unix/exit.c
@@ -14,8 +14,7 @@
#include <mlvalues.h>
#include "unixsupport.h"
-value unix_exit(n) /* ML */
- value n;
+value unix_exit(value n) /* ML */
{
_exit(Int_val(n));
return Val_unit; /* never reached, but suppress warnings */
diff --git a/otherlibs/unix/fchmod.c b/otherlibs/unix/fchmod.c
index 07c608c44..9f5ddc675 100644
--- a/otherlibs/unix/fchmod.c
+++ b/otherlibs/unix/fchmod.c
@@ -18,8 +18,7 @@
#ifdef HAS_FCHMOD
-value unix_fchmod(fd, perm) /* ML */
- value fd, perm;
+value unix_fchmod(value fd, value perm) /* ML */
{
if (fchmod(Int_val(fd), Int_val(perm)) == -1) uerror("fchmod", Nothing);
return Val_unit;
@@ -27,6 +26,7 @@ value unix_fchmod(fd, perm) /* ML */
#else
-value unix_fchmod() { invalid_argument("fchmod not implemented"); }
+value unix_fchmod(value fd, value perm)
+{ invalid_argument("fchmod not implemented"); }
#endif
diff --git a/otherlibs/unix/fchown.c b/otherlibs/unix/fchown.c
index 3272a3043..ef5df88b6 100644
--- a/otherlibs/unix/fchown.c
+++ b/otherlibs/unix/fchown.c
@@ -16,8 +16,7 @@
#ifdef HAS_FCHMOD
-value unix_fchown(fd, uid, gid) /* ML */
- value fd, uid, gid;
+value unix_fchown(value fd, value uid, value gid) /* ML */
{
if (fchown(Int_val(fd), Int_val(uid), Int_val(gid)) == -1)
uerror("fchown", Nothing);
@@ -26,6 +25,7 @@ value unix_fchown(fd, uid, gid) /* ML */
#else
-value unix_fchown() { invalid_argument("fchown not implemented"); }
+value unix_fchown(value fd, value uid, value gid)
+{ invalid_argument("fchown not implemented"); }
#endif
diff --git a/otherlibs/unix/fcntl.c b/otherlibs/unix/fcntl.c
index 1324aa2bc..e50662f01 100644
--- a/otherlibs/unix/fcntl.c
+++ b/otherlibs/unix/fcntl.c
@@ -22,8 +22,7 @@
#define O_NONBLOCK O_NDELAY
#endif
-value unix_set_nonblock(fd)
- value fd;
+value unix_set_nonblock(value fd)
{
int retcode;
retcode = fcntl(Int_val(fd), F_GETFL, 0);
@@ -33,8 +32,7 @@ value unix_set_nonblock(fd)
return Val_unit;
}
-value unix_clear_nonblock(fd)
- value fd;
+value unix_clear_nonblock(value fd)
{
int retcode;
retcode = fcntl(Int_val(fd), F_GETFL, 0);
@@ -46,8 +44,7 @@ value unix_clear_nonblock(fd)
#ifdef FD_CLOEXEC
-value unix_set_close_on_exec(fd)
- value fd;
+value unix_set_close_on_exec(value fd)
{
int retcode;
retcode = fcntl(Int_val(fd), F_GETFD, 0);
@@ -57,8 +54,7 @@ value unix_set_close_on_exec(fd)
return Val_unit;
}
-value unix_clear_close_on_exec(fd)
- value fd;
+value unix_clear_close_on_exec(value fd)
{
int retcode;
retcode = fcntl(Int_val(fd), F_GETFD, 0);
@@ -70,10 +66,10 @@ value unix_clear_close_on_exec(fd)
#else
-value unix_set_close_on_exec()
+value unix_set_close_on_exec(value fd)
{ invalid_argument("set_close_on_exec not implemented"); }
-value unix_clear_close_on_exec()
+value unix_clear_close_on_exec(value fd)
{ invalid_argument("clear_close_on_exec not implemented"); }
#endif
diff --git a/otherlibs/unix/fork.c b/otherlibs/unix/fork.c
index 82c4fde4c..91cd25467 100644
--- a/otherlibs/unix/fork.c
+++ b/otherlibs/unix/fork.c
@@ -14,8 +14,7 @@
#include <mlvalues.h>
#include "unixsupport.h"
-value unix_fork(unit) /* ML */
- value unit;
+value unix_fork(value unit) /* ML */
{
int ret;
ret = fork();
diff --git a/otherlibs/unix/ftruncate.c b/otherlibs/unix/ftruncate.c
index e0b68ab4c..4821e0e6b 100644
--- a/otherlibs/unix/ftruncate.c
+++ b/otherlibs/unix/ftruncate.c
@@ -16,8 +16,7 @@
#ifdef HAS_TRUNCATE
-value unix_ftruncate(fd, len) /* ML */
- value fd, len;
+value unix_ftruncate(value fd, value len) /* ML */
{
if (ftruncate(Int_val(fd), Long_val(len)) == -1)
uerror("ftruncate", Nothing);
@@ -26,6 +25,7 @@ value unix_ftruncate(fd, len) /* ML */
#else
-value unix_ftruncate() { invalid_argument("ftruncate not implemented"); }
+value unix_ftruncate(value fd, value len)
+{ invalid_argument("ftruncate not implemented"); }
#endif
diff --git a/otherlibs/unix/getcwd.c b/otherlibs/unix/getcwd.c
index 5d97b0ba4..1c7b19f73 100644
--- a/otherlibs/unix/getcwd.c
+++ b/otherlibs/unix/getcwd.c
@@ -23,7 +23,7 @@
#define MAXPATHLEN 512
#endif
-value unix_getcwd() /* ML */
+value unix_getcwd(value unit) /* ML */
{
char buff[MAXPATHLEN];
if (getcwd(buff, sizeof(buff)) == 0) uerror("getcwd", Nothing);
@@ -35,7 +35,7 @@ value unix_getcwd() /* ML */
#include <sys/param.h>
-value unix_getcwd()
+value unix_getcwd(value unit)
{
char buff[MAXPATHLEN];
if (getwd(buff) == 0) uerror("getcwd", copy_string(buff));
@@ -44,7 +44,8 @@ value unix_getcwd()
#else
-value unix_getcwd() { invalid_argument("getcwd not implemented"); }
+value unix_getcwd(value unit)
+{ invalid_argument("getcwd not implemented"); }
#endif
#endif
diff --git a/otherlibs/unix/getegid.c b/otherlibs/unix/getegid.c
index 43f38d04d..19c4125cf 100644
--- a/otherlibs/unix/getegid.c
+++ b/otherlibs/unix/getegid.c
@@ -14,7 +14,7 @@
#include <mlvalues.h>
#include "unixsupport.h"
-value unix_getegid() /* ML */
+value unix_getegid(void) /* ML */
{
return Val_int(getegid());
}
diff --git a/otherlibs/unix/geteuid.c b/otherlibs/unix/geteuid.c
index a77b646fc..e5b6b4d93 100644
--- a/otherlibs/unix/geteuid.c
+++ b/otherlibs/unix/geteuid.c
@@ -14,7 +14,7 @@
#include <mlvalues.h>
#include "unixsupport.h"
-value unix_geteuid() /* ML */
+value unix_geteuid(void) /* ML */
{
return Val_int(geteuid());
}
diff --git a/otherlibs/unix/getgid.c b/otherlibs/unix/getgid.c
index 5cc3899f1..8b23a59c4 100644
--- a/otherlibs/unix/getgid.c
+++ b/otherlibs/unix/getgid.c
@@ -14,7 +14,7 @@
#include <mlvalues.h>
#include "unixsupport.h"
-value unix_getgid() /* ML */
+value unix_getgid(void) /* ML */
{
return Val_int(getgid());
}
diff --git a/otherlibs/unix/getgr.c b/otherlibs/unix/getgr.c
index b98a8e59e..253d0bf6d 100644
--- a/otherlibs/unix/getgr.c
+++ b/otherlibs/unix/getgr.c
@@ -19,8 +19,7 @@
#include <stdio.h>
#include <grp.h>
-static value alloc_group_entry(entry)
- struct group * entry;
+static value alloc_group_entry(struct group *entry)
{
value res;
value name = Val_unit, pass = Val_unit, mem = Val_unit;
@@ -38,8 +37,7 @@ static value alloc_group_entry(entry)
return res;
}
-value unix_getgrnam(name) /* ML */
- value name;
+value unix_getgrnam(value name) /* ML */
{
struct group * entry;
entry = getgrnam(String_val(name));
@@ -47,8 +45,7 @@ value unix_getgrnam(name) /* ML */
return alloc_group_entry(entry);
}
-value unix_getgrgid(gid) /* ML */
- value gid;
+value unix_getgrgid(value gid) /* ML */
{
struct group * entry;
entry = getgrgid(Int_val(gid));
diff --git a/otherlibs/unix/getgroups.c b/otherlibs/unix/getgroups.c
index 4c9b2d3fc..741acbcf3 100644
--- a/otherlibs/unix/getgroups.c
+++ b/otherlibs/unix/getgroups.c
@@ -20,7 +20,7 @@
#include <sys/param.h>
#include "unixsupport.h"
-value unix_getgroups() /* ML */
+value unix_getgroups(value unit) /* ML */
{
gid_t gidset[NGROUPS];
int n;
@@ -37,6 +37,7 @@ value unix_getgroups() /* ML */
#else
-value unix_getgroups() { invalid_argument("getgroups not implemented"); }
+value unix_getgroups(value unit)
+{ invalid_argument("getgroups not implemented"); }
#endif
diff --git a/otherlibs/unix/gethost.c b/otherlibs/unix/gethost.c
index 5eb8f6790..07766f057 100644
--- a/otherlibs/unix/gethost.c
+++ b/otherlibs/unix/gethost.c
@@ -30,15 +30,13 @@ static int entry_h_length;
extern int socket_domain_table[];
-static value alloc_one_addr(a)
- char * a;
+static value alloc_one_addr(char *a)
{
bcopy(a, &sock_addr.s_inet.sin_addr, entry_h_length);
return alloc_inet_addr(sock_addr.s_inet.sin_addr.s_addr);
}
-static value alloc_host_entry(entry)
- struct hostent * entry;
+static value alloc_host_entry(struct hostent *entry)
{
value res;
value name = Val_unit, aliases = Val_unit;
@@ -64,8 +62,7 @@ static value alloc_host_entry(entry)
return res;
}
-value unix_gethostbyaddr(a) /* ML */
- value a;
+value unix_gethostbyaddr(value a) /* ML */
{
uint32 addr;
struct hostent * entry;
@@ -77,8 +74,7 @@ value unix_gethostbyaddr(a) /* ML */
return alloc_host_entry(entry);
}
-value unix_gethostbyname(name) /* ML */
- value name;
+value unix_gethostbyname(value name) /* ML */
{
char hostname[256];
struct hostent * entry;
@@ -93,10 +89,10 @@ value unix_gethostbyname(name) /* ML */
#else
-value unix_gethostbyaddr()
+value unix_gethostbyaddr(value name)
{ invalid_argument("gethostbyaddr not implemented"); }
-value unix_gethostbyname()
+value unix_gethostbyname(value name)
{ invalid_argument("gethostbyname not implemented"); }
#endif
diff --git a/otherlibs/unix/gethostname.c b/otherlibs/unix/gethostname.c
index ca5da31ae..a755e4749 100644
--- a/otherlibs/unix/gethostname.c
+++ b/otherlibs/unix/gethostname.c
@@ -26,7 +26,7 @@
#define MAXHOSTNAMELEN 256
#endif
-value unix_gethostname() /* ML */
+value unix_gethostname(value unit) /* ML */
{
char name[MAXHOSTNAMELEN];
gethostname(name, MAXHOSTNAMELEN);
@@ -39,7 +39,7 @@ value unix_gethostname() /* ML */
#include <sys/utsname.h>
-value unix_gethostname()
+value unix_gethostname(value unit)
{
struct utsname un;
uname(&un);
@@ -48,7 +48,8 @@ value unix_gethostname()
#else
-value unix_gethostname() { invalid_argument("gethostname not implemented"); }
+value unix_gethostname(value unit)
+{ invalid_argument("gethostname not implemented"); }
#endif
#endif
diff --git a/otherlibs/unix/getlogin.c b/otherlibs/unix/getlogin.c
index 42f46f393..d5d4870d7 100644
--- a/otherlibs/unix/getlogin.c
+++ b/otherlibs/unix/getlogin.c
@@ -16,9 +16,9 @@
#include "unixsupport.h"
#include <errno.h>
-extern char * getlogin();
+extern char * getlogin(void);
-value unix_getlogin() /* ML */
+value unix_getlogin(void) /* ML */
{
char * name;
name = getlogin();
diff --git a/otherlibs/unix/getpeername.c b/otherlibs/unix/getpeername.c
index 3f00060af..0b3624622 100644
--- a/otherlibs/unix/getpeername.c
+++ b/otherlibs/unix/getpeername.c
@@ -18,8 +18,7 @@
#include "socketaddr.h"
-value unix_getpeername(sock) /* ML */
- value sock;
+value unix_getpeername(value sock) /* ML */
{
int retcode;
@@ -31,6 +30,7 @@ value unix_getpeername(sock) /* ML */
#else
-value unix_getpeername() { invalid_argument("getpeername not implemented"); }
+value unix_getpeername(value sock)
+{ invalid_argument("getpeername not implemented"); }
#endif
diff --git a/otherlibs/unix/getpid.c b/otherlibs/unix/getpid.c
index 6d95c615e..f8b7d238f 100644
--- a/otherlibs/unix/getpid.c
+++ b/otherlibs/unix/getpid.c
@@ -14,7 +14,7 @@
#include <mlvalues.h>
#include "unixsupport.h"
-value unix_getpid() /* ML */
+value unix_getpid(void) /* ML */
{
return Val_int(getpid());
}
diff --git a/otherlibs/unix/getppid.c b/otherlibs/unix/getppid.c
index d403209b4..8207e7551 100644
--- a/otherlibs/unix/getppid.c
+++ b/otherlibs/unix/getppid.c
@@ -14,7 +14,7 @@
#include <mlvalues.h>
#include "unixsupport.h"
-value unix_getppid() /* ML */
+value unix_getppid(void) /* ML */
{
return Val_int(getppid());
}
diff --git a/otherlibs/unix/getproto.c b/otherlibs/unix/getproto.c
index 8cdbadb8e..5fff35d31 100644
--- a/otherlibs/unix/getproto.c
+++ b/otherlibs/unix/getproto.c
@@ -25,8 +25,7 @@
#include <winsock.h>
#endif
-static value alloc_proto_entry(entry)
- struct protoent * entry;
+static value alloc_proto_entry(struct protoent *entry)
{
value res;
value name = Val_unit, aliases = Val_unit;
@@ -42,8 +41,7 @@ static value alloc_proto_entry(entry)
return res;
}
-value unix_getprotobyname(name) /* ML */
- value name;
+value unix_getprotobyname(value name) /* ML */
{
struct protoent * entry;
entry = getprotobyname(String_val(name));
@@ -51,8 +49,7 @@ value unix_getprotobyname(name) /* ML */
return alloc_proto_entry(entry);
}
-value unix_getprotobynumber(proto) /* ML */
- value proto;
+value unix_getprotobynumber(value proto) /* ML */
{
struct protoent * entry;
entry = getprotobynumber(Int_val(proto));
@@ -62,10 +59,10 @@ value unix_getprotobynumber(proto) /* ML */
#else
-value unix_getprotobynumber()
+value unix_getprotobynumber(value proto)
{ invalid_argument("getprotobynumber not implemented"); }
-value unix_getprotobyname()
+value unix_getprotobyname(value name)
{ invalid_argument("getprotobyname not implemented"); }
#endif
diff --git a/otherlibs/unix/getpw.c b/otherlibs/unix/getpw.c
index fa4132d19..c4f3e17fa 100644
--- a/otherlibs/unix/getpw.c
+++ b/otherlibs/unix/getpw.c
@@ -18,8 +18,7 @@
#include "unixsupport.h"
#include <pwd.h>
-static value alloc_passwd_entry(entry)
- struct passwd * entry;
+static value alloc_passwd_entry(struct passwd *entry)
{
value res;
value name = Val_unit, passwd = Val_unit, gecos = Val_unit;
@@ -43,8 +42,7 @@ static value alloc_passwd_entry(entry)
return res;
}
-value unix_getpwnam(name) /* ML */
- value name;
+value unix_getpwnam(value name) /* ML */
{
struct passwd * entry;
entry = getpwnam(String_val(name));
@@ -52,8 +50,7 @@ value unix_getpwnam(name) /* ML */
return alloc_passwd_entry(entry);
}
-value unix_getpwuid(uid) /* ML */
- value uid;
+value unix_getpwuid(value uid) /* ML */
{
struct passwd * entry;
entry = getpwuid(Int_val(uid));
diff --git a/otherlibs/unix/getserv.c b/otherlibs/unix/getserv.c
index 1d876ce30..e927dbe33 100644
--- a/otherlibs/unix/getserv.c
+++ b/otherlibs/unix/getserv.c
@@ -29,8 +29,7 @@
#include <winsock.h>
#endif
-static value alloc_service_entry(entry)
- struct servent * entry;
+static value alloc_service_entry(struct servent *entry)
{
value res;
value name = Val_unit, aliases = Val_unit, proto = Val_unit;
@@ -48,8 +47,7 @@ static value alloc_service_entry(entry)
return res;
}
-value unix_getservbyname(name, proto) /* ML */
- value name, proto;
+value unix_getservbyname(value name, value proto) /* ML */
{
struct servent * entry;
entry = getservbyname(String_val(name), String_val(proto));
@@ -57,8 +55,7 @@ value unix_getservbyname(name, proto) /* ML */
return alloc_service_entry(entry);
}
-value unix_getservbyport(port, proto) /* ML */
- value port, proto;
+value unix_getservbyport(value port, value proto) /* ML */
{
struct servent * entry;
entry = getservbyport(Int_val(port), String_val(proto));
@@ -68,10 +65,10 @@ value unix_getservbyport(port, proto) /* ML */
#else
-value unix_getservbyport()
+value unix_getservbyport(value port, value proto)
{ invalid_argument("getservbyport not implemented"); }
-value unix_getservbyname()
+value unix_getservbyname(value name, value proto)
{ invalid_argument("getservbyname not implemented"); }
#endif
diff --git a/otherlibs/unix/getsockname.c b/otherlibs/unix/getsockname.c
index 4831618a8..0275a1240 100644
--- a/otherlibs/unix/getsockname.c
+++ b/otherlibs/unix/getsockname.c
@@ -18,8 +18,7 @@
#include "socketaddr.h"
-value unix_getsockname(sock) /* ML */
- value sock;
+value unix_getsockname(value sock) /* ML */
{
int retcode;
@@ -31,6 +30,7 @@ value unix_getsockname(sock) /* ML */
#else
-value unix_getsockname() { invalid_argument("getsockname not implemented"); }
+value unix_getsockname(value sock)
+{ invalid_argument("getsockname not implemented"); }
#endif
diff --git a/otherlibs/unix/gettimeofday.c b/otherlibs/unix/gettimeofday.c
index d1fd6cb64..80a5a231c 100644
--- a/otherlibs/unix/gettimeofday.c
+++ b/otherlibs/unix/gettimeofday.c
@@ -7,7 +7,7 @@
#include <sys/types.h>
#include <sys/time.h>
-value unix_gettimeofday() /* ML */
+value unix_gettimeofday(value unit) /* ML */
{
struct timeval tp;
if (gettimeofday(&tp, NULL) == -1) uerror("gettimeofday", Nothing);
@@ -16,6 +16,7 @@ value unix_gettimeofday() /* ML */
#else
-value unix_gettimeofday() { invalid_argument("gettimeofday not implemented"); }
+value unix_gettimeofday(value unit)
+{ invalid_argument("gettimeofday not implemented"); }
#endif
diff --git a/otherlibs/unix/getuid.c b/otherlibs/unix/getuid.c
index 58d62cce4..19d98e570 100644
--- a/otherlibs/unix/getuid.c
+++ b/otherlibs/unix/getuid.c
@@ -14,7 +14,7 @@
#include <mlvalues.h>
#include "unixsupport.h"
-value unix_getuid() /* ML */
+value unix_getuid(void) /* ML */
{
return Val_int(getuid());
}
diff --git a/otherlibs/unix/gmtime.c b/otherlibs/unix/gmtime.c
index f875cb5a4..3ade3ec95 100644
--- a/otherlibs/unix/gmtime.c
+++ b/otherlibs/unix/gmtime.c
@@ -17,8 +17,7 @@
#include "unixsupport.h"
#include <time.h>
-static value alloc_tm(tm)
- struct tm * tm;
+static value alloc_tm(struct tm *tm)
{
value res;
res = alloc_tuple(9);
@@ -34,16 +33,14 @@ static value alloc_tm(tm)
return res;
}
-value unix_gmtime(t) /* ML */
- value t;
+value unix_gmtime(value t) /* ML */
{
time_t clock;
clock = Long_val(t);
return alloc_tm(gmtime(&clock));
}
-value unix_localtime(t) /* ML */
- value t;
+value unix_localtime(value t) /* ML */
{
time_t clock;
clock = Long_val(t);
@@ -52,8 +49,7 @@ value unix_localtime(t) /* ML */
#ifdef HAS_MKTIME
-value unix_mktime(t) /* ML */
- value t;
+value unix_mktime(value t) /* ML */
{
struct tm tm;
time_t clock;
@@ -81,6 +77,6 @@ value unix_mktime(t) /* ML */
#else
-value unix_mktime() { invalid_argument("mktime not implemented"); }
+value unix_mktime(value t) { invalid_argument("mktime not implemented"); }
#endif
diff --git a/otherlibs/unix/itimer.c b/otherlibs/unix/itimer.c
index c407a44bb..749c514ef 100644
--- a/otherlibs/unix/itimer.c
+++ b/otherlibs/unix/itimer.c
@@ -26,8 +26,7 @@
tv.tv_sec = (int)(d), \
tv.tv_usec = (int) (1e6 * ((d) - tv.tv_sec))
-static value unix_convert_itimer(tp)
- struct itimerval * tp;
+static value unix_convert_itimer(struct itimerval *tp)
{
value res;
value interval = Val_unit, v = Val_unit;
@@ -42,8 +41,7 @@ static value unix_convert_itimer(tp)
return res;
}
-static value unix_convert_itimer_native(tp)
- struct itimerval * tp;
+static value unix_convert_itimer_native(struct itimerval *tp)
{
value res = alloc(Double_wosize * 2, Double_array_tag);
Store_double_field(res, 0, Get_timeval(tp->it_interval));
@@ -53,8 +51,7 @@ static value unix_convert_itimer_native(tp)
static int itimers[3] = { ITIMER_REAL, ITIMER_VIRTUAL, ITIMER_PROF };
-value unix_setitimer(which, newval)
- value which, newval;
+value unix_setitimer(value which, value newval)
{
struct itimerval new, old;
Set_timeval(new.it_interval, Double_val(Field(newval, 0)));
@@ -64,8 +61,7 @@ value unix_setitimer(which, newval)
return unix_convert_itimer(&old);
}
-value unix_setitimer_native(which, newval)
- value which, newval;
+value unix_setitimer_native(value which, value newval)
{
struct itimerval new, old;
Set_timeval(new.it_interval, Double_field(newval, 0));
@@ -75,8 +71,7 @@ value unix_setitimer_native(which, newval)
return unix_convert_itimer_native(&old);
}
-value unix_getitimer(which)
- value which;
+value unix_getitimer(value which)
{
struct itimerval val;
if (getitimer(itimers[Int_val(which)], &val) == -1)
@@ -84,8 +79,7 @@ value unix_getitimer(which)
return unix_convert_itimer(&val);
}
-value unix_getitimer_native(which)
- value which;
+value unix_getitimer_native(value which)
{
struct itimerval val;
if (getitimer(itimers[Int_val(which)], &val) == -1)
@@ -95,13 +89,13 @@ value unix_getitimer_native(which)
#else
-value unix_setitimer()
+value unix_setitimer(value which, value newval)
{ invalid_argument("setitimer not implemented"); }
-value unix_getitimer()
+value unix_getitimer(value which)
{ invalid_argument("getitimer not implemented"); }
-value unix_setitimer_native()
+value unix_setitimer_native(value which, value newval)
{ invalid_argument("setitimer not implemented"); }
-value unix_getitimer_native()
+value unix_getitimer_native(value which)
{ invalid_argument("getitimer not implemented"); }
#endif
diff --git a/otherlibs/unix/kill.c b/otherlibs/unix/kill.c
index e117200b7..89b4c37b2 100644
--- a/otherlibs/unix/kill.c
+++ b/otherlibs/unix/kill.c
@@ -18,8 +18,7 @@
extern int posix_signals[]; /* defined in byterun/signals.c */
-value unix_kill(pid, signal) /* ML */
- value pid, signal;
+value unix_kill(value pid, value signal) /* ML */
{
int sig;
sig = Int_val(signal);
diff --git a/otherlibs/unix/link.c b/otherlibs/unix/link.c
index b9c17e4d1..e8fe69932 100644
--- a/otherlibs/unix/link.c
+++ b/otherlibs/unix/link.c
@@ -14,8 +14,7 @@
#include <mlvalues.h>
#include "unixsupport.h"
-value unix_link(path1, path2) /* ML */
- value path1, path2;
+value unix_link(value path1, value path2) /* ML */
{
if (link(String_val(path1), String_val(path2)) == -1) uerror("link", path2);
return Val_unit;
diff --git a/otherlibs/unix/listen.c b/otherlibs/unix/listen.c
index f8db79407..9992625a3 100644
--- a/otherlibs/unix/listen.c
+++ b/otherlibs/unix/listen.c
@@ -18,8 +18,7 @@
#include <sys/socket.h>
-value unix_listen(sock, backlog)
- value sock, backlog;
+value unix_listen(value sock, value backlog)
{
if (listen(Int_val(sock), Int_val(backlog)) == -1) uerror("listen", Nothing);
return Val_unit;
@@ -27,6 +26,7 @@ value unix_listen(sock, backlog)
#else
-value unix_listen() { invalid_argument("listen not implemented"); }
+value unix_listen(value sock, value backlog)
+{ invalid_argument("listen not implemented"); }
#endif
diff --git a/otherlibs/unix/lockf.c b/otherlibs/unix/lockf.c
index 0da87549d..2cffcd062 100644
--- a/otherlibs/unix/lockf.c
+++ b/otherlibs/unix/lockf.c
@@ -28,8 +28,7 @@ static int lock_command_table[] = {
F_ULOCK, F_LOCK, F_TLOCK, F_TEST
};
-value unix_lockf(fd, cmd, span) /* ML */
- value fd, cmd, span;
+value unix_lockf(value fd, value cmd, value span) /* ML */
{
if (lockf(Int_val(fd), lock_command_table[Int_val(cmd)], Long_val(span))
== -1) uerror("lockf", Nothing);
@@ -43,8 +42,7 @@ value unix_lockf(fd, cmd, span) /* ML */
#ifdef F_SETLK
-value unix_lockf(fd, cmd, span) /* ML */
- value fd, cmd, span;
+value unix_lockf(value fd, value cmd, value span) /* ML */
{
struct flock l;
int ret;
@@ -96,7 +94,8 @@ value unix_lockf(fd, cmd, span) /* ML */
#else
-value unix_lockf() { invalid_argument("lockf not implemented"); }
+value unix_lockf(value fd, value cmd, value span)
+{ invalid_argument("lockf not implemented"); }
#endif
#endif
diff --git a/otherlibs/unix/lseek.c b/otherlibs/unix/lseek.c
index c785f1c8d..ffb1d0b81 100644
--- a/otherlibs/unix/lseek.c
+++ b/otherlibs/unix/lseek.c
@@ -26,8 +26,7 @@ static int seek_command_table[] = {
SEEK_SET, SEEK_CUR, SEEK_END
};
-value unix_lseek(fd, ofs, cmd) /* ML */
- value fd, ofs, cmd;
+value unix_lseek(value fd, value ofs, value cmd) /* ML */
{
long ret;
ret = lseek(Int_val(fd), Long_val(ofs),
diff --git a/otherlibs/unix/mkdir.c b/otherlibs/unix/mkdir.c
index 330d366ff..937883786 100644
--- a/otherlibs/unix/mkdir.c
+++ b/otherlibs/unix/mkdir.c
@@ -16,8 +16,7 @@
#include <mlvalues.h>
#include "unixsupport.h"
-value unix_mkdir(path, perm) /* ML */
- value path, perm;
+value unix_mkdir(value path, value perm) /* ML */
{
if (mkdir(String_val(path), Int_val(perm)) == -1) uerror("mkdir", path);
return Val_unit;
diff --git a/otherlibs/unix/mkfifo.c b/otherlibs/unix/mkfifo.c
index f187baf8c..1be28bf5c 100644
--- a/otherlibs/unix/mkfifo.c
+++ b/otherlibs/unix/mkfifo.c
@@ -18,9 +18,7 @@
#ifdef HAS_MKFIFO
-value unix_mkfifo(path, mode)
- value path;
- value mode;
+value unix_mkfifo(value path, value mode)
{
if (mkfifo(String_val(path), Int_val(mode)) == -1)
uerror("mkfifo", path);
@@ -34,9 +32,7 @@ value unix_mkfifo(path, mode)
#ifdef S_IFIFO
-value unix_mkfifo(path, mode)
- value path;
- value mode;
+value unix_mkfifo(value path, value mode)
{
if (mknod(String_val(path), (Int_val(mode) & 07777) | S_IFIFO, 0) == -1)
uerror("mkfifo", path);
diff --git a/otherlibs/unix/nice.c b/otherlibs/unix/nice.c
index dbd9805db..d89ea2a71 100644
--- a/otherlibs/unix/nice.c
+++ b/otherlibs/unix/nice.c
@@ -21,8 +21,7 @@
#include <sys/time.h>
#include <sys/resource.h>
-value unix_nice(incr)
- value incr;
+value unix_nice(value incr)
{
int prio;
errno = 0;
@@ -37,8 +36,7 @@ value unix_nice(incr)
#else
-value unix_nice(incr)
- value incr;
+value unix_nice(value incr)
{
int ret;
errno = 0;
diff --git a/otherlibs/unix/open.c b/otherlibs/unix/open.c
index 32ccc20b1..eef6a8761 100644
--- a/otherlibs/unix/open.c
+++ b/otherlibs/unix/open.c
@@ -24,8 +24,7 @@ static int open_flag_table[] = {
O_RDONLY, O_WRONLY, O_RDWR, O_NONBLOCK, O_APPEND, O_CREAT, O_TRUNC, O_EXCL
};
-value unix_open(path, flags, perm) /* ML */
- value path, flags, perm;
+value unix_open(value path, value flags, value perm) /* ML */
{
int ret;
diff --git a/otherlibs/unix/opendir.c b/otherlibs/unix/opendir.c
index 924ab05f2..552c38c34 100644
--- a/otherlibs/unix/opendir.c
+++ b/otherlibs/unix/opendir.c
@@ -20,8 +20,7 @@
#include <sys/dir.h>
#endif
-value unix_opendir(path) /* ML */
- value path;
+value unix_opendir(value path) /* ML */
{
DIR * d;
d = opendir(String_val(path));
diff --git a/otherlibs/unix/pause.c b/otherlibs/unix/pause.c
index d8f337e16..275853038 100644
--- a/otherlibs/unix/pause.c
+++ b/otherlibs/unix/pause.c
@@ -14,7 +14,7 @@
#include <mlvalues.h>
#include "unixsupport.h"
-value unix_pause() /* ML */
+value unix_pause(void) /* ML */
{
pause();
return Val_unit;
diff --git a/otherlibs/unix/pipe.c b/otherlibs/unix/pipe.c
index e3446108e..683fa9993 100644
--- a/otherlibs/unix/pipe.c
+++ b/otherlibs/unix/pipe.c
@@ -15,7 +15,7 @@
#include <alloc.h>
#include "unixsupport.h"
-value unix_pipe() /* ML */
+value unix_pipe(void) /* ML */
{
int fd[2];
value res;
diff --git a/otherlibs/unix/read.c b/otherlibs/unix/read.c
index 17ef9109c..cbcae9d02 100644
--- a/otherlibs/unix/read.c
+++ b/otherlibs/unix/read.c
@@ -17,8 +17,7 @@
#include <signals.h>
#include "unixsupport.h"
-value unix_read(fd, buf, ofs, len) /* ML */
- value fd, buf, ofs, len;
+value unix_read(value fd, value buf, value ofs, value len) /* ML */
{
long numbytes;
int ret;
diff --git a/otherlibs/unix/readdir.c b/otherlibs/unix/readdir.c
index 330cd485d..098886165 100644
--- a/otherlibs/unix/readdir.c
+++ b/otherlibs/unix/readdir.c
@@ -24,8 +24,7 @@ typedef struct dirent directory_entry;
typedef struct direct directory_entry;
#endif
-value unix_readdir(d) /* ML */
- value d;
+value unix_readdir(value d) /* ML */
{
directory_entry * e;
diff --git a/otherlibs/unix/readlink.c b/otherlibs/unix/readlink.c
index fa467a3ca..885b6243a 100644
--- a/otherlibs/unix/readlink.c
+++ b/otherlibs/unix/readlink.c
@@ -19,8 +19,7 @@
#include <sys/param.h>
#include "unixsupport.h"
-value unix_readlink(path) /* ML */
- value path;
+value unix_readlink(value path) /* ML */
{
char buffer[MAXPATHLEN];
int len;
@@ -32,6 +31,7 @@ value unix_readlink(path) /* ML */
#else
-value unix_readlink() { invalid_argument("readlink not implemented"); }
+value unix_readlink(value path)
+{ invalid_argument("readlink not implemented"); }
#endif
diff --git a/otherlibs/unix/rename.c b/otherlibs/unix/rename.c
index 5a1e32f16..35c3fade3 100644
--- a/otherlibs/unix/rename.c
+++ b/otherlibs/unix/rename.c
@@ -15,8 +15,7 @@
#include <mlvalues.h>
#include "unixsupport.h"
-value unix_rename(path1, path2) /* ML */
- value path1, path2;
+value unix_rename(value path1, value path2) /* ML */
{
if (rename(String_val(path1), String_val(path2)) == -1)
uerror("rename", path1);
diff --git a/otherlibs/unix/rewinddir.c b/otherlibs/unix/rewinddir.c
index 56d6f9d84..2d2942e25 100644
--- a/otherlibs/unix/rewinddir.c
+++ b/otherlibs/unix/rewinddir.c
@@ -22,8 +22,7 @@
#ifdef HAS_REWINDDIR
-value unix_rewinddir(d) /* ML */
- value d;
+value unix_rewinddir(value d) /* ML */
{
rewinddir((DIR *) d);
return Val_unit;
@@ -31,6 +30,7 @@ value unix_rewinddir(d) /* ML */
#else
-value unix_rewinddir() { invalid_argument("rewinddir not implemented"); }
+value unix_rewinddir(value d)
+{ invalid_argument("rewinddir not implemented"); }
#endif
diff --git a/otherlibs/unix/rmdir.c b/otherlibs/unix/rmdir.c
index 20907492b..d5b01748d 100644
--- a/otherlibs/unix/rmdir.c
+++ b/otherlibs/unix/rmdir.c
@@ -14,8 +14,7 @@
#include <mlvalues.h>
#include "unixsupport.h"
-value unix_rmdir(path) /* ML */
- value path;
+value unix_rmdir(value path) /* ML */
{
if (rmdir(String_val(path)) == -1) uerror("rmdir", path);
return Val_unit;
diff --git a/otherlibs/unix/select.c b/otherlibs/unix/select.c
index 3452ab0df..c24756069 100644
--- a/otherlibs/unix/select.c
+++ b/otherlibs/unix/select.c
@@ -36,9 +36,7 @@ typedef int file_descr_set;
#define FD_ZERO(fds) (*(fds) = 0)
#endif
-static void fdlist_to_fdset(fdlist, fdset)
- value fdlist;
- file_descr_set * fdset;
+static void fdlist_to_fdset(value fdlist, file_descr_set *fdset)
{
value l;
FD_ZERO(fdset);
@@ -47,8 +45,7 @@ static void fdlist_to_fdset(fdlist, fdset)
}
}
-static value fdset_to_fdlist(fdset)
- file_descr_set * fdset;
+static value fdset_to_fdlist(file_descr_set *fdset)
{
int i;
value res = Val_int(0);
@@ -66,8 +63,7 @@ static value fdset_to_fdlist(fdset)
return res;
}
-value unix_select(readfds, writefds, exceptfds, timeout) /* ML */
- value readfds, writefds, exceptfds, timeout;
+value unix_select(value readfds, value writefds, value exceptfds, value timeout) /* ML */
{
file_descr_set read, write, except;
double tm;
@@ -106,6 +102,7 @@ value unix_select(readfds, writefds, exceptfds, timeout) /* ML */
#else
-value unix_select() { invalid_argument("select not implemented"); }
+value unix_select(value readfds, value writefds, value exceptfds, value timeout)
+{ invalid_argument("select not implemented"); }
#endif
diff --git a/otherlibs/unix/sendrecv.c b/otherlibs/unix/sendrecv.c
index a729472c6..899a0663f 100644
--- a/otherlibs/unix/sendrecv.c
+++ b/otherlibs/unix/sendrecv.c
@@ -28,8 +28,7 @@ static int msg_flag_table[] = {
MSG_OOB, MSG_DONTROUTE, MSG_PEEK
};
-value unix_recv(sock, buff, ofs, len, flags) /* ML */
- value sock, buff, ofs, len, flags;
+value unix_recv(value sock, value buff, value ofs, value len, value flags) /* ML */
{
int ret;
long numbytes;
@@ -48,8 +47,7 @@ value unix_recv(sock, buff, ofs, len, flags) /* ML */
return Val_int(ret);
}
-value unix_recvfrom(sock, buff, ofs, len, flags) /* ML */
- value sock, buff, ofs, len, flags;
+value unix_recvfrom(value sock, value buff, value ofs, value len, value flags) /* ML */
{
int ret;
long numbytes;
@@ -76,8 +74,7 @@ value unix_recvfrom(sock, buff, ofs, len, flags) /* ML */
return res;
}
-value unix_send(sock, buff, ofs, len, flags) /* ML */
- value sock, buff, ofs, len, flags;
+value unix_send(value sock, value buff, value ofs, value len, value flags) /* ML */
{
int ret;
long numbytes;
@@ -94,8 +91,7 @@ value unix_send(sock, buff, ofs, len, flags) /* ML */
return Val_int(ret);
}
-value unix_sendto_native(sock, buff, ofs, len, flags, dest)
- value sock, buff, ofs, len, flags, dest;
+value unix_sendto_native(value sock, value buff, value ofs, value len, value flags, value dest)
{
int ret;
long numbytes;
@@ -114,9 +110,7 @@ value unix_sendto_native(sock, buff, ofs, len, flags, dest)
return Val_int(ret);
}
-value unix_sendto(argv, argc) /* ML */
- value * argv;
- int argc;
+value unix_sendto(value *argv, int argc) /* ML */
{
return unix_sendto_native
(argv[0], argv[1], argv[2], argv[3], argv[4], argv[5]);
@@ -124,14 +118,19 @@ value unix_sendto(argv, argc) /* ML */
#else
-value unix_recv() { invalid_argument("recv not implemented"); }
+value unix_recv(value sock, value buff, value ofs, value len, value flags)
+{ invalid_argument("recv not implemented"); }
-value unix_recvfrom() { invalid_argument("recvfrom not implemented"); }
+value unix_recvfrom(value sock, value buff, value ofs, value len, value flags)
+{ invalid_argument("recvfrom not implemented"); }
-value unix_send() { invalid_argument("send not implemented"); }
+value unix_send(value sock, value buff, value ofs, value len, value flags)
+{ invalid_argument("send not implemented"); }
-value unix_sendto_native() { invalid_argument("sendto not implemented"); }
+value unix_sendto_native(value sock, value buff, value ofs, value len, value flags, value dest)
+{ invalid_argument("sendto not implemented"); }
-value unix_sendto() { invalid_argument("sendto not implemented"); }
+value unix_sendto(value *argv, int argc)
+{ invalid_argument("sendto not implemented"); }
#endif
diff --git a/otherlibs/unix/setgid.c b/otherlibs/unix/setgid.c
index 482f25a8b..596a01d33 100644
--- a/otherlibs/unix/setgid.c
+++ b/otherlibs/unix/setgid.c
@@ -14,8 +14,7 @@
#include <mlvalues.h>
#include "unixsupport.h"
-value unix_setgid(gid) /* ML */
- value gid;
+value unix_setgid(value gid) /* ML */
{
if (setgid(Int_val(gid)) == -1) uerror("setgid", Nothing);
return Val_unit;
diff --git a/otherlibs/unix/setsid.c b/otherlibs/unix/setsid.c
index ada098c8b..b1d1f41dc 100644
--- a/otherlibs/unix/setsid.c
+++ b/otherlibs/unix/setsid.c
@@ -17,8 +17,7 @@
#include <unistd.h>
#endif
-value unix_setsid(unit) /* ML */
- value unit;
+value unix_setsid(value unit) /* ML */
{
#ifdef HAS_SETSID
return Val_int(setsid());
diff --git a/otherlibs/unix/setuid.c b/otherlibs/unix/setuid.c
index 4b3a1d9b4..b7a28204f 100644
--- a/otherlibs/unix/setuid.c
+++ b/otherlibs/unix/setuid.c
@@ -14,8 +14,7 @@
#include <mlvalues.h>
#include "unixsupport.h"
-value unix_setuid(uid) /* ML */
- value uid;
+value unix_setuid(value uid) /* ML */
{
if (setuid(Int_val(uid)) == -1) uerror("setuid", Nothing);
return Val_unit;
diff --git a/otherlibs/unix/shutdown.c b/otherlibs/unix/shutdown.c
index 96098b7c5..0117f7947 100644
--- a/otherlibs/unix/shutdown.c
+++ b/otherlibs/unix/shutdown.c
@@ -22,8 +22,7 @@ static int shutdown_command_table[] = {
0, 1, 2
};
-value unix_shutdown(sock, cmd) /* ML */
- value sock, cmd;
+value unix_shutdown(value sock, value cmd) /* ML */
{
if (shutdown(Int_val(sock), shutdown_command_table[Int_val(cmd)]) == -1)
uerror("shutdown", Nothing);
@@ -32,6 +31,7 @@ value unix_shutdown(sock, cmd) /* ML */
#else
-value unix_shutdown() { invalid_argument("shutdown not implemented"); }
+value unix_shutdown(value sock, value cmd)
+{ invalid_argument("shutdown not implemented"); }
#endif
diff --git a/otherlibs/unix/sleep.c b/otherlibs/unix/sleep.c
index 1f245bc9d..3ba68c2c7 100644
--- a/otherlibs/unix/sleep.c
+++ b/otherlibs/unix/sleep.c
@@ -15,8 +15,7 @@
#include <signals.h>
#include "unixsupport.h"
-value unix_sleep(t) /* ML */
- value t;
+value unix_sleep(value t) /* ML */
{
enter_blocking_section();
sleep(Int_val(t));
diff --git a/otherlibs/unix/socket.c b/otherlibs/unix/socket.c
index bdf884d38..4539ecc0a 100644
--- a/otherlibs/unix/socket.c
+++ b/otherlibs/unix/socket.c
@@ -27,8 +27,7 @@ int socket_type_table[] = {
SOCK_STREAM, SOCK_DGRAM, SOCK_RAW, SOCK_SEQPACKET
};
-value unix_socket(domain, type, proto) /* ML */
- value domain, type, proto;
+value unix_socket(value domain, value type, value proto) /* ML */
{
int retcode;
retcode = socket(socket_domain_table[Int_val(domain)],
@@ -41,6 +40,7 @@ value unix_socket(domain, type, proto) /* ML */
#else
-value unix_socket() { invalid_argument("socket not implemented"); }
+value unix_socket(value domain, value type, value proto)
+{ invalid_argument("socket not implemented"); }
#endif
diff --git a/otherlibs/unix/socketaddr.c b/otherlibs/unix/socketaddr.c
index d4485eeb7..db1fc23b0 100644
--- a/otherlibs/unix/socketaddr.c
+++ b/otherlibs/unix/socketaddr.c
@@ -30,8 +30,7 @@
union sock_addr_union sock_addr;
int sock_addr_len;
-value alloc_inet_addr(a)
- unsigned int a;
+value alloc_inet_addr(unsigned int a)
{
value res;
res = alloc_string(sizeof(uint32));
@@ -39,8 +38,7 @@ value alloc_inet_addr(a)
return res;
}
-void get_sockaddr(a)
- value a;
+void get_sockaddr(value a)
{
switch(Tag_val(a)) {
#ifndef _WIN32
@@ -76,7 +74,7 @@ void get_sockaddr(a)
}
}
-value alloc_sockaddr()
+value alloc_sockaddr(void)
{
value res;
switch(sock_addr.s_gen.sa_family) {
diff --git a/otherlibs/unix/socketaddr.h b/otherlibs/unix/socketaddr.h
index 65c1a4782..8b4486167 100644
--- a/otherlibs/unix/socketaddr.h
+++ b/otherlibs/unix/socketaddr.h
@@ -27,8 +27,8 @@ union sock_addr_union {
extern union sock_addr_union sock_addr;
extern int sock_addr_len;
-void get_sockaddr P((value));
-value alloc_sockaddr P((void));
-value alloc_inet_addr P((unsigned int));
+void get_sockaddr (value);
+value alloc_sockaddr (void);
+value alloc_inet_addr (unsigned int);
#define GET_INET_ADDR(v) (*((uint32 *) (v)))
diff --git a/otherlibs/unix/socketpair.c b/otherlibs/unix/socketpair.c
index 67dec4ee1..0f325a471 100644
--- a/otherlibs/unix/socketpair.c
+++ b/otherlibs/unix/socketpair.c
@@ -21,8 +21,7 @@
extern int socket_domain_table[], socket_type_table[];
-value unix_socketpair(domain, type, proto) /* ML */
- value domain, type, proto;
+value unix_socketpair(value domain, value type, value proto) /* ML */
{
int sv[2];
value res;
@@ -38,6 +37,7 @@ value unix_socketpair(domain, type, proto) /* ML */
#else
-value unix_socketpair() { invalid_argument("socketpair not implemented"); }
+value unix_socketpair(value domain, value type, value proto)
+{ invalid_argument("socketpair not implemented"); }
#endif
diff --git a/otherlibs/unix/sockopt.c b/otherlibs/unix/sockopt.c
index 01725a1ef..d358b2261 100644
--- a/otherlibs/unix/sockopt.c
+++ b/otherlibs/unix/sockopt.c
@@ -30,8 +30,7 @@ static int sockopt[] = {
SO_DEBUG, SO_BROADCAST, SO_REUSEADDR, SO_KEEPALIVE,
SO_DONTROUTE, SO_OOBINLINE };
-value unix_getsockopt(socket, option)
- value socket, option;
+value unix_getsockopt(value socket, value option)
{
int optval, optsize;
optsize = sizeof(optval);
@@ -41,8 +40,7 @@ value unix_getsockopt(socket, option)
return Val_int(optval);
}
-value unix_setsockopt(socket, option, status)
- value socket, option, status;
+value unix_setsockopt(value socket, value option, value status)
{
int optval = Int_val(status);
if (setsockopt(Int_val(socket), SOL_SOCKET, sockopt[Int_val(option)],
@@ -53,7 +51,10 @@ value unix_setsockopt(socket, option, status)
#else
-value unix_getsockopt() { invalid_argument("getsockopt not implemented"); }
-value unix_setsockopt() { invalid_argument("setsockopt not implemented"); }
+value unix_getsockopt(value socket, value option)
+{ invalid_argument("getsockopt not implemented"); }
+
+value unix_setsockopt(value socket, value option, value status)
+{ invalid_argument("setsockopt not implemented"); }
#endif
diff --git a/otherlibs/unix/stat.c b/otherlibs/unix/stat.c
index 1791e0e33..da5da047e 100644
--- a/otherlibs/unix/stat.c
+++ b/otherlibs/unix/stat.c
@@ -35,8 +35,7 @@ static int file_kind_table[] = {
S_IFREG, S_IFDIR, S_IFCHR, S_IFBLK, S_IFLNK, S_IFIFO, S_IFSOCK
};
-static value stat_aux(buf)
- struct stat * buf;
+static value stat_aux(struct stat *buf)
{
value v;
@@ -57,8 +56,7 @@ static value stat_aux(buf)
return v;
}
-value unix_stat(path) /* ML */
- value path;
+value unix_stat(value path) /* ML */
{
int ret;
struct stat buf;
@@ -67,8 +65,7 @@ value unix_stat(path) /* ML */
return stat_aux(&buf);
}
-value unix_lstat(path) /* ML */
- value path;
+value unix_lstat(value path) /* ML */
{
int ret;
struct stat buf;
@@ -81,8 +78,7 @@ value unix_lstat(path) /* ML */
return stat_aux(&buf);
}
-value unix_fstat(fd) /* ML */
- value fd;
+value unix_fstat(value fd) /* ML */
{
int ret;
struct stat buf;
diff --git a/otherlibs/unix/strofaddr.c b/otherlibs/unix/strofaddr.c
index 4503f6c30..25d45a830 100644
--- a/otherlibs/unix/strofaddr.c
+++ b/otherlibs/unix/strofaddr.c
@@ -19,8 +19,7 @@
#include "socketaddr.h"
-value unix_string_of_inet_addr(a) /* ML */
- value a;
+value unix_string_of_inet_addr(value a) /* ML */
{
struct in_addr address;
address.s_addr = GET_INET_ADDR(a);
@@ -29,7 +28,7 @@ value unix_string_of_inet_addr(a) /* ML */
#else
-value unix_string_of_inet_addr()
+value unix_string_of_inet_addr(value a)
{ invalid_argument("string_of_inet_addr not implemented"); }
#endif
diff --git a/otherlibs/unix/symlink.c b/otherlibs/unix/symlink.c
index 9d5bf15f9..9a2e1fe44 100644
--- a/otherlibs/unix/symlink.c
+++ b/otherlibs/unix/symlink.c
@@ -16,8 +16,7 @@
#ifdef HAS_SYMLINK
-value unix_symlink(path1, path2) /* ML */
- value path1, path2;
+value unix_symlink(value path1, value path2) /* ML */
{
if (symlink(String_val(path1), String_val(path2)) == -1)
uerror("symlink", path2);
@@ -26,6 +25,7 @@ value unix_symlink(path1, path2) /* ML */
#else
-value unix_symlink() { invalid_argument("symlink not implemented"); }
+value unix_symlink(value path1, value path2)
+{ invalid_argument("symlink not implemented"); }
#endif
diff --git a/otherlibs/unix/termios.c b/otherlibs/unix/termios.c
index 7153fca17..1f0ffa332 100644
--- a/otherlibs/unix/termios.c
+++ b/otherlibs/unix/termios.c
@@ -116,8 +116,7 @@ static struct {
#define NSPEEDS (sizeof(speedtable) / sizeof(speedtable[0]))
-static void encode_terminal_status(dst)
- value * dst;
+static void encode_terminal_status(value *dst)
{
long * pc;
int i;
@@ -166,8 +165,7 @@ static void encode_terminal_status(dst)
}
}
-static void decode_terminal_status(src)
- value * src;
+static void decode_terminal_status(value *src)
{
long * pc;
int i;
@@ -222,8 +220,7 @@ static void decode_terminal_status(src)
}
}
-value unix_tcgetattr(fd)
- value fd;
+value unix_tcgetattr(value fd)
{
value res;
@@ -238,8 +235,7 @@ static int when_flag_table[] = {
TCSANOW, TCSADRAIN, TCSAFLUSH
};
-value unix_tcsetattr(fd, when, arg)
- value fd, when, arg;
+value unix_tcsetattr(value fd, value when, value arg)
{
if (tcgetattr(Int_val(fd), &terminal_status) == -1)
uerror("tcsetattr", Nothing);
@@ -251,16 +247,14 @@ value unix_tcsetattr(fd, when, arg)
return Val_unit;
}
-value unix_tcsendbreak(fd, delay)
- value fd, delay;
+value unix_tcsendbreak(value fd, value delay)
{
if (tcsendbreak(Int_val(fd), Int_val(delay)) == -1)
uerror("tcsendbreak", Nothing);
return Val_unit;
}
-value unix_tcdrain(fd)
- value fd;
+value unix_tcdrain(value fd)
{
if (tcdrain(Int_val(fd)) == -1) uerror("tcdrain", Nothing);
return Val_unit;
@@ -270,8 +264,7 @@ static int queue_flag_table[] = {
TCIFLUSH, TCOFLUSH, TCIOFLUSH
};
-value unix_tcflush(fd, queue)
- value fd, queue;
+value unix_tcflush(value fd, value queue)
{
if (tcflush(Int_val(fd), queue_flag_table[Int_val(queue)]) == -1)
uerror("tcflush", Nothing);
@@ -282,8 +275,7 @@ static int action_flag_table[] = {
TCOOFF, TCOON, TCIOFF, TCION
};
-value unix_tcflow(fd, action)
- value fd, action;
+value unix_tcflow(value fd, value action)
{
if (tcflow(Int_val(fd), action_flag_table[Int_val(action)]) == -1)
uerror("tcflow", Nothing);
@@ -292,12 +284,23 @@ value unix_tcflow(fd, action)
#else
-value unix_tcgetattr() { invalid_argument("tcgetattr not implemented"); }
-value unix_tcsetattr() { invalid_argument("tcsetattr not implemented"); }
-value unix_tcsendbreak() { invalid_argument("tcsendbreak not implemented"); }
-value unix_tcdrain() { invalid_argument("tcdrain not implemented"); }
-value unix_tcflush() { invalid_argument("tcflush not implemented"); }
-value unix_tcflow() { invalid_argument("tcflow not implemented"); }
+value unix_tcgetattr(value fd)
+{ invalid_argument("tcgetattr not implemented"); }
+
+value unix_tcsetattr(value fd, value when, value arg)
+{ invalid_argument("tcsetattr not implemented"); }
+
+value unix_tcsendbreak(value fd, value delay)
+{ invalid_argument("tcsendbreak not implemented"); }
+
+value unix_tcdrain(value fd)
+{ invalid_argument("tcdrain not implemented"); }
+
+value unix_tcflush(value fd, value queue)
+{ invalid_argument("tcflush not implemented"); }
+
+value unix_tcflow(value fd, value action)
+{ invalid_argument("tcflow not implemented"); }
#endif
diff --git a/otherlibs/unix/time.c b/otherlibs/unix/time.c
index 6a16ff00e..4278053fb 100644
--- a/otherlibs/unix/time.c
+++ b/otherlibs/unix/time.c
@@ -11,12 +11,11 @@
/* $Id$ */
+#include <time.h>
#include <mlvalues.h>
#include "unixsupport.h"
-extern long time();
-
-value unix_time() /* ML */
+value unix_time(void) /* ML */
{
- return Val_long(time((long *) NULL));
+ return Val_long(time((time_t *) NULL));
}
diff --git a/otherlibs/unix/times.c b/otherlibs/unix/times.c
index 4f9cc074b..7253648a9 100644
--- a/otherlibs/unix/times.c
+++ b/otherlibs/unix/times.c
@@ -27,7 +27,7 @@
#endif
#endif
-value unix_times_bytecode() /* ML */
+value unix_times_bytecode(void) /* ML */
{
value res;
struct tms buffer;
@@ -48,7 +48,7 @@ value unix_times_bytecode() /* ML */
return res;
}
-value unix_times_native() /* ML */
+value unix_times_native(void) /* ML */
{
value res;
struct tms buffer;
diff --git a/otherlibs/unix/truncate.c b/otherlibs/unix/truncate.c
index d3e0407ea..f84ac4e1c 100644
--- a/otherlibs/unix/truncate.c
+++ b/otherlibs/unix/truncate.c
@@ -16,8 +16,7 @@
#ifdef HAS_TRUNCATE
-value unix_truncate(path, len) /* ML */
- value path, len;
+value unix_truncate(value path, value len) /* ML */
{
if (truncate(String_val(path), Long_val(len)) == -1)
uerror("truncate", path);
@@ -26,6 +25,7 @@ value unix_truncate(path, len) /* ML */
#else
-value unix_truncate() { invalid_argument("truncate not implemented"); }
+value unix_truncate(value path, value len)
+{ invalid_argument("truncate not implemented"); }
#endif
diff --git a/otherlibs/unix/umask.c b/otherlibs/unix/umask.c
index 4c19cba04..3d177c6dc 100644
--- a/otherlibs/unix/umask.c
+++ b/otherlibs/unix/umask.c
@@ -16,8 +16,7 @@
#include <mlvalues.h>
#include "unixsupport.h"
-value unix_umask(perm) /* ML */
- value perm;
+value unix_umask(value perm) /* ML */
{
return Val_int(umask(Int_val(perm)));
}
diff --git a/otherlibs/unix/unixsupport.c b/otherlibs/unix/unixsupport.c
index d78d91351..ebdcf3940 100644
--- a/otherlibs/unix/unixsupport.c
+++ b/otherlibs/unix/unixsupport.c
@@ -242,10 +242,7 @@ int error_table[] = {
static value * unix_error_exn = NULL;
-void unix_error(errcode, cmdname, cmdarg)
- int errcode;
- char * cmdname;
- value cmdarg;
+void unix_error(int errcode, char *cmdname, value cmdarg)
{
value res;
value name = Val_unit, arg = Val_unit;
@@ -269,9 +266,7 @@ void unix_error(errcode, cmdname, cmdarg)
mlraise(res);
}
-void uerror(cmdname, cmdarg)
- char * cmdname;
- value cmdarg;
+void uerror(char *cmdname, value cmdarg)
{
unix_error(errno, cmdname, cmdarg);
}
diff --git a/otherlibs/unix/unixsupport.h b/otherlibs/unix/unixsupport.h
index c8b7e1e03..557383619 100644
--- a/otherlibs/unix/unixsupport.h
+++ b/otherlibs/unix/unixsupport.h
@@ -17,7 +17,7 @@
#define Nothing ((value) 0)
-extern void unix_error P((int errcode, char * cmdname, value arg)) Noreturn;
-extern void uerror P((char * cmdname, value arg)) Noreturn;
+extern void unix_error (int errcode, char * cmdname, value arg) Noreturn;
+extern void uerror (char * cmdname, value arg) Noreturn;
#define UNIX_BUFFER_SIZE 16384
diff --git a/otherlibs/unix/unlink.c b/otherlibs/unix/unlink.c
index d1f89347b..9017ecd86 100644
--- a/otherlibs/unix/unlink.c
+++ b/otherlibs/unix/unlink.c
@@ -14,8 +14,7 @@
#include <mlvalues.h>
#include "unixsupport.h"
-value unix_unlink(path) /* ML */
- value path;
+value unix_unlink(value path) /* ML */
{
if (unlink(String_val(path)) == -1) uerror("unlink", path);
return Val_unit;
diff --git a/otherlibs/unix/utimes.c b/otherlibs/unix/utimes.c
index 8874a4e0a..371144aec 100644
--- a/otherlibs/unix/utimes.c
+++ b/otherlibs/unix/utimes.c
@@ -23,8 +23,7 @@
#include <sys/utime.h>
#endif
-value unix_utimes(path, atime, mtime) /* ML */
- value path, atime, mtime;
+value unix_utimes(value path, value atime, value mtime) /* ML */
{
struct utimbuf times, * t;
times.actime = Int_val(atime);
@@ -44,8 +43,7 @@ value unix_utimes(path, atime, mtime) /* ML */
#include <sys/types.h>
#include <sys/time.h>
-value unix_utimes(path, atime, mtime) /* ML */
- value path, atime, mtime;
+value unix_utimes(value path, value atime, value mtime) /* ML */
{
struct timeval tv[2], * t;
tv[0].tv_sec = Int_val(atime);
@@ -62,7 +60,8 @@ value unix_utimes(path, atime, mtime) /* ML */
#else
-value unix_utimes() { invalid_argument("utimes not implemented"); }
+value unix_utimes(value path, value atime, value mtime)
+{ invalid_argument("utimes not implemented"); }
#endif
#endif
diff --git a/otherlibs/unix/wait.c b/otherlibs/unix/wait.c
index 78ef7621e..75151a1f5 100644
--- a/otherlibs/unix/wait.c
+++ b/otherlibs/unix/wait.c
@@ -34,8 +34,7 @@
#define TAG_WSIGNALED 1
#define TAG_WSTOPPED 2
-static value alloc_process_status(pid, status)
- int pid, status;
+static value alloc_process_status(int pid, int status)
{
value st, res;
@@ -59,7 +58,7 @@ static value alloc_process_status(pid, status)
return res;
}
-value unix_wait() /* ML */
+value unix_wait(void) /* ML */
{
int pid, status;
@@ -80,8 +79,7 @@ static int wait_flag_table[] = {
WNOHANG, WUNTRACED
};
-value unix_waitpid(flags, pid_req)
- value flags, pid_req;
+value unix_waitpid(value flags, value pid_req)
{
int pid, status;
@@ -95,6 +93,7 @@ value unix_waitpid(flags, pid_req)
#else
-value unix_waitpid() { invalid_argument("waitpid not implemented"); }
+value unix_waitpid(value flags, value pid_req)
+{ invalid_argument("waitpid not implemented"); }
#endif
diff --git a/otherlibs/unix/write.c b/otherlibs/unix/write.c
index 83de1fa08..7bd9d11f9 100644
--- a/otherlibs/unix/write.c
+++ b/otherlibs/unix/write.c
@@ -25,8 +25,7 @@
#define EWOULDBLOCK (-1)
#endif
-value unix_write(fd, buf, vofs, vlen) /* ML */
- value fd, buf, vofs, vlen;
+value unix_write(value fd, value buf, value vofs, value vlen) /* ML */
{
long ofs, len, written;
int numbytes, ret;