Copyright (C) 1994, Digital Equipment Corp.
************************************************************************* Author: Geoffrey Wyant - Sun Microsystems Labs BOS *************************************************************************
$Revision$
MODULE; IMPORT Uerror; FROM Ctypes IMPORT int; Unix
* This is to work around a bug in the Solaris-2 'libsocket' library * which redefines 'fcntl' in such a way as to zero out 'errno' if the * call is successful.
PROCEDUREfcntl (fd, request, arg: int): int = VAR errno := Uerror.errno; res := raw_fcntl(fd, request, arg); BEGIN IF res = 0 THEN Uerror.errno := errno; END; RETURN res; END fcntl;
* This is to work around a bug in the Solaris-2 'libsocket' library * which redefines 'ioctl' in such a way as to zero out 'errno' if the * call is successful.
PROCEDUREioctl (fd, request: int; argp: ADDRESS): int = VAR errno := Uerror.errno; res := raw_ioctl(fd, request, argp); BEGIN IF res = 0 THEN Uerror.errno := errno; END; RETURN res; END ioctl; BEGIN END Unix.