diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-04 13:12:13 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-04 13:12:13 +0000 |
commit | bbbd9c0b7be96824e4648b551b3a66763df38788 (patch) | |
tree | 6ff6cd1d2496e9394fb712108e63906f6b2d9e0c /x68/select.c | |
parent | 0c0e636b19559715798dcbf6493cb4327c60488f (diff) | |
download | ruby-bbbd9c0b7be96824e4648b551b3a66763df38788.tar.gz |
* x68/_dtos18.c: removed. Ruby no longer supports human68k.
* x68/_round.c: ditto.
* x68/fconvert.c: ditto.
* x68/select.c: ditto.
* ext/Setup.x68: ditto.
* missing/x68.c: ditto.
* dln.c (dln_find_exe_r): removed human68k supports.
(dln_find_1): ditto.
* lib/mkmf.rb: ditto.
* ext/extmk.rb (Init_ext): ditto.
* ext/socket/socket.c (init_sock): ditto.
* gc.c (GC_MALLOC_LIMIT): ditto.
(rb_setjmp, rb_jmpbuf): ditto.
(mark_current_machine_context): ditto.
* include/ruby/defines.h (PATH_ENV): ditto.
* io.c: ditto.
* process.c: ditto.
* ruby.c: ditto.
* test/ruby/test_env.rb: ditto.
* test/ruby/test_path.rb: ditto.
* LEGAL
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'x68/select.c')
-rw-r--r-- | x68/select.c | 167 |
1 files changed, 0 insertions, 167 deletions
diff --git a/x68/select.c b/x68/select.c deleted file mode 100644 index b4bf464032..0000000000 --- a/x68/select.c +++ /dev/null @@ -1,167 +0,0 @@ -/* - * PROJECT C Library, X68000 PROGRAMMING INTERFACE DEFINITION - * -------------------------------------------------------------------- - * This file is written by the Project C Library Group, and completely - * in public domain. You can freely use, copy, modify, and redistribute - * the whole contents, without this notice. - * -------------------------------------------------------------------- - * $Id$ - */ - -#ifndef __IOCS_INLINE__ -#define __IOCS_INLINE__ -#define __DOS_INLINE__ -#define __DOS_DOSCALL__ -#endif - -/* System headers */ -#include <errno.h> -#include <fcntl.h> -#include <string.h> -#include <sys/dos.h> -#include <sys/iocs.h> -#include <sys/time.h> -#include <sys/types.h> -#if 0 -#include <sys/select.h> -#include <sys/xsocket.h> -#endif -#include <sys/xunistd.h> - -/* Macros */ -#define XFD_ISSET(fd,fds) ((fds) && FD_ISSET ((fd), (fds))) -#define isreadable(mode) ((mode) == O_RDONLY || (mode) == O_RDWR) -#define iswritable(mode) ((mode) == O_WRONLY || (mode) == O_RDWR) -#ifndef _POSIX_FD_SETSIZE -#define _POSIX_FD_SETSIZE OPEN_MAX -#endif - -/* Functions */ -int -select (int fds, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeval *timeout) -{ - fd_set oread, owrite, oexcept; - int ticks, start; - int nfds; - - if (fds > _POSIX_FD_SETSIZE) - { - errno = EINVAL; - return -1; - } - - FD_ZERO (&oread); - FD_ZERO (&owrite); - FD_ZERO (&oexcept); - - nfds = 0; - ticks = -1; - - if (timeout) - { - ticks = timeout->tv_sec * 100 + timeout->tv_usec / 10000; - if (ticks < 0) - { - errno = EINVAL; - return -1; - } - } - - start = _iocs_ontime (); - for (;;) - { - { - int fd; - - for (fd = 0; fd < fds; fd++) - { - int accmode; - - if (_fddb[fd].inuse == _FD_NOTUSED) - continue; - - accmode = _fddb[fd].oflag & O_ACCMODE; - - if (isatty (fd)) - { - if (XFD_ISSET (fd, rfds) && isreadable (accmode) && _dos_k_keysns ()) - { - FD_SET (fd, &oread); - nfds++; - } - - if (XFD_ISSET (fd, wfds) && iswritable (accmode)) - { - FD_SET (fd, &owrite); - nfds++; - } - } -#if 0 - else if (_fddb[fd].sockno >= 0) - { - if (XFD_ISSET (fd, rfds) && _socklen (_fddb[fd].sockno, 0)) - { - FD_SET (fd, &oread); - nfds++; - } - - if (XFD_ISSET (fd, wfds) /* && _socklen (_fddb[fd].sockno, 1) == 0 */) - { - FD_SET (fd, &owrite); - nfds++; - } - } -#endif - else - { - if (XFD_ISSET (fd, rfds) && isreadable (accmode) && _dos_ioctrlis (fd)) - { - FD_SET (fd, &oread); - nfds++; - } - - if (XFD_ISSET (fd, wfds) && iswritable (accmode) && _dos_ioctrlos (fd)) - { - FD_SET (fd, &owrite); - nfds++; - } - } - } - } - - { - int rest; - - if ((rest = (_iocs_ontime () - start) % 8640000) < 0) - rest += 8640000; - - if (nfds != 0) - { - if (ticks >= 0) - { - int left; - - if ((left = ticks - rest) < 0) - left = 0; - - timeout->tv_sec = left / 100; - timeout->tv_usec = (left % 100) * 10000; - } - - if (rfds) - *rfds = oread; - if (wfds) - *wfds = owrite; - if (efds) - *efds = oexcept; - - return nfds; - } - - if (ticks >= 0 && rest > ticks) - return 0; - } - - _dos_change_pr (); - } -} |