From: Rick Sladkey (jrs@world.std.com)
Date: 09/16/92


From: jrs@world.std.com (Rick Sladkey)
Subject: Re: Where is <sys/syscall.h> in Linux?
Date: 17 Sep 1992 02:11:51 GMT


>>>>> On Wed, 16 Sep 1992 13:49:03 GMT, lmfken@lmf.ericsson.se
>>>>> (Kenneth Osterberg) said:

Kenneth> I'm also trying to port an application using syscall(), and
Kenneth> it needs it because it redefines some functions which reside
Kenneth> in the standard libraries. Eg. it defines an own version of
Kenneth> select(), and within that select() it want's to do the real
Kenneth> system call. (btw. the app. I'm talking about is the XView
Kenneth> toolkit)

A lot of people have been asking for XView. I have the Remote Procedure
Call library compiled and working if you need it.

Anyway, this is a way to redefine the select system call with Linux.

#include <sys/time.h>

#define __LIBRARY__
#include <unistd.h>
#undef __LIBRARY__

#define __NR_sys_select __NR_select

_syscall5(int,sys_select,int,width,fd_set *,readfds,fd_set *,writefds,
        fd_set,exceptfds,struct timeval *,timeout);

int select(int width, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
        struct timeval *timeout)
{
        /* some stuff */
        sys_select(...);
        /* other stuff */
}