From 04e0dd200cc89beb9b9628e3cda35f1705016af5 Mon Sep 17 00:00:00 2001 From: mickey Date: Sun, 30 Mar 1997 20:15:06 +0000 Subject: [PATCH] my recent fixes --- sys/lib/libsa/unixdev.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/sys/lib/libsa/unixdev.c b/sys/lib/libsa/unixdev.c index fdb7335cbe9..cb98acd0cfb 100644 --- a/sys/lib/libsa/unixdev.c +++ b/sys/lib/libsa/unixdev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: unixdev.c,v 1.2 1997/03/25 20:30:46 niklas Exp $ */ +/* $OpenBSD: unixdev.c,v 1.3 1997/03/30 20:15:06 mickey Exp $ */ /* * Copyright (c) 1996 Michael Shalayeff @@ -34,9 +34,12 @@ #include #include -#include +#include #include - +#include +#define open uopen +#include +#undef open #include "libsa.h" #include "unixdev.h" @@ -121,8 +124,7 @@ ulseek( fd, off, wh) off_t off; int wh; { - /* XXX zecond zero is unclear to me, but it works */ - return syscall((quad_t)SYS_lseek, fd, 0, off, 0, wh); + return __syscall((quad_t)SYS_lseek, fd, 0, off, wh); } @@ -149,14 +151,19 @@ unix_getc() int unix_ischar() { - return 0; -} - -void -usleep(n) - u_int n; -{ - + struct timeval tv; + fd_set fdset; + int rc; + + tv.tv_sec = 0; + tv.tv_usec = 100000; + FD_ZERO(&fdset); + FD_SET(0, &fdset); + + if ((rc = syscall(SYS_select, 1, &fdset, NULL, NULL, &tv)) <= 0) + return 0; + else + return 1; } time_t -- 2.20.1