diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 1996-04-12 15:57:28 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 1996-04-12 15:57:28 +0000 |
commit | ee1266885025393876a3c42857881cd75b50f562 (patch) | |
tree | 4b8313e781c5d3be15af0c868dd01c7f7f1132ac /otherlibs/unix/waitpid.c | |
parent | a9aac029f688b5f71f748697dbea937c526faaae (diff) |
Ajout de setitimer, setsockopt, inet_addr_any.
Suppression de fcntl, ajout de fonctions pour manipuler le mode non
bloquant et le bit close on exec.
Nettoyage des codes d'erreur (plus proches de POSIX).
Nettoyages divers.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@742 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/unix/waitpid.c')
-rw-r--r-- | otherlibs/unix/waitpid.c | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/otherlibs/unix/waitpid.c b/otherlibs/unix/waitpid.c deleted file mode 100644 index 934bfc7c2..000000000 --- a/otherlibs/unix/waitpid.c +++ /dev/null @@ -1,65 +0,0 @@ -/***********************************************************************/ -/* */ -/* Caml Special Light */ -/* */ -/* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ -/* */ -/* Copyright 1995 Institut National de Recherche en Informatique et */ -/* Automatique. Distributed only by permission. */ -/* */ -/***********************************************************************/ - -/* $Id$ */ - -#include <mlvalues.h> -#include <alloc.h> -#include <memory.h> -#include "unix.h" - -#ifdef HAS_WAITPID - -#include <sys/types.h> -#include <sys/wait.h> - -static int wait_flag_table[] = { - WNOHANG, WUNTRACED -}; - -value unix_waitpid(flags, pid_req) - value flags, pid_req; -{ - int pid, status; - value res; - Push_roots(r, 1); -#define st r[0] - - pid = waitpid(Int_val(pid_req), &status, - convert_flag_list(flags, wait_flag_table)); - if (pid == -1) uerror("waitpid", Nothing); - switch (status & 0xFF) { - case 0: - st = alloc(1, 0); - Field(st, 0) = Val_int((status >> 8) & 0xFF); - break; - case 0177: - st = alloc(1, 2); - Field(st, 0) = Val_int((status >> 8) & 0xFF); - break; - default: - st = alloc(2, 1); - Field(st, 0) = Val_int(status & 0x3F); - Field(st, 1) = status & 0200 ? Val_true : Val_false; - break; - } - res = alloc_tuple(2); - Field(res, 0) = Val_int(pid); - Field(res, 1) = st; - Pop_roots(); - return res; -} - -#else - -value unix_waitpid() { invalid_argument("waitpid not implemented"); } - -#endif |