-->

Previous | Table of Contents | Next

Page 772

HISTORY

These system calls appeared in BSD 4.2.

BUGS

Several of the socket options should be handled at lower levels of the system.

SEE ALSO


ioctl(2), socket(2), getprotoent(3), protocols(5)

BSD Man Page, 22 April 1996

gettimeofday, settimeofday

gettimeofday, settimeofday—Get/set time

SYNOPSIS


#include <sys/time.h>

#include <unistd.h>



int gettimeofday(struct timeval *tv, struct timezone *tz);

int settimeofday(const struct timeval *tv , const struct timezone *tz);

DESCRIPTION

gettimeofday and settimeofday can set the time as well as a time zone. tv is a timeval struct, as specified in /usr/include/sys/time.h:


struct timeval {

                      long tv_sec;        /* seconds */

                      long tv_usec;  /* microseconds */

                      };



       and tz is a timezone:



       struct timezone {

                       int  tz_minuteswest;

                       /* minutes west of Greenwich */

                       int  tz_dsttime;

                       /* type of dst correction */

                       };

with daylight savings times defined as follows:


DST_NONE        /* not on dst */

       DST_USA         /* USA style dst */

       DST_AUST        /* Australian style dst */

       DST_WET         /* Western European dst */

       DST_MET         /* Middle European dst */

       DST_EET         /* Eastern European dst */

       DST_CAN         /* Canada */

       DST_GB          /* Great Britain and Eire */

       DST_RUM         /* Rumania */

       DST_TUR         /* Turkey */

       DST_AUSTALT     /* Australian style with shift in 1986 */

Page 773

And the following macros are defined to operate on this :


#define   timerisset(tvp)\

                  ((tvp)->tv_sec || (tvp)->tv_usec)

       #define   timercmp(tvp, uvp, cmp)\

                  ((tvp)->tv_sec cmp (uvp)->tv_sec ||\

                  (tvp)->tv_sec == (uvp)->tv_sec &&\

                  (tvp)->tv_usec cmp (uvp)->tv_usec)

       #define   timerclear(tvp)

                  ((tvp)->tv_sec = (tvp)->tv_usec = 0)

If either tv or tz is null, the corresponding structure is not set or returned.

Only the superuser can use settimeofday.

ERRORS

EPERM settimeofday is called by someone other than the superuser.
EINVAL Time zone (or something else) is invalid.

CONFORMS TO

BSD 4.3

SEE ALSO


date(1), adjtimex(2), time(2), ctime(3), ftime(3)

Linux 1.2.4, 15 April 1995

getuid, geteuid

getuid, geteuid—Get user identity

SYNOPSIS


#include <unistd.h>

uid_t getuid(void);

uid_t geteuid(void);

DESCRIPTION

getuid returns the real user ID of the current process.

geteuid returns the effective user ID of the current process.

The real ID corresponds to the ID of the calling process. The effective ID corresponds to the set ID bit on the file being executed.

ERRORS

These functions are always successful.

CONFORMS TO

POSIX, BSD 4.3

SEE ALSO


setreuid(2), setuid(2)

Linux 0.99.11, 23 July 1993

Page 774

idle

idle—Makes process 0 idle

SYNOPSIS


#include <unistd.h>

void idle(void);

DESCRIPTION

idle is an internal system call used during bootstrap. It marks the process's pages as swappable, lowers its priority, and enters the main scheduling loop. idle never returns.

Only process 0 may call idle. Any user process, even a process with superuser permission, will receive EPERM.

RETURN VALUE

idle never returns for process 0, and always returns _1 for a user process.

ERRORS

EPERM Always, for a user process.

Linux 1.1.46, 21 August 1994

ioctl

ioctl—Controls devices

SYNOPSIS


#include <sys/ioctl.h>

int ioctl(int d,intrequest, ...);

(The "third" argument is traditionally char *argp and will be so named for this discussion.)

DESCRIPTION

The ioctl function manipulates the underlying device parameters of special files. In particular, many operating characteristics of character special files (for example, terminals) may be controlled with ioctl requests. The argument d must be an open file descriptor.

An ioctl request has encoded in it whether the argument is an in parameter or out parameter, and the size of the argument argp in bytes. Macros and defines used in specifying an ioctl request are located in the file <sys/ioctl.h>.

RETURN VALUE

On success, 0 is returned. On error, _1 is returned and errno is set appropriately.

ERRORS

EBADF d is not a valid descriptor.
ENOTTY d is not associated with a character special device.
ENOTTY The specified request does not apply to the kind of object that the descriptor d references.
EINVAL request or argp is not valid.

HISTORY

An ioctl function call appeared in version 7 AT&T UNIX.

Page 775

SEE ALSO


execve(2), fcntl(2), mt(4), sd(4), tty(4)

INTRODUCTION

This is ioctl List 1.3.27, a list of ioctl calls in Linux/i386 kernel 1.3.27. It contains 421 ioctls from /usr/include/fasm,linuxg/*.h. For each ioctl, you'll find the numerical value, name, and argument type.

An argument type of const struct foo * means the argument is input to the kernel. struct foo * means the kernel outputs the argument. If the kernel uses the argument for both input and output, this is marked with // I-O.

Some ioctls take more arguments or return more values than a single structure. These are marked // MORE and are documented further in a separate section.

This list is incomplete. It does not include

And, of course, I may have errors and omissions.

Please e-mail changes and comments to mec@duracef.shout.net. I am particularly interested in loadable modules that define their own ioctls. If you know of such a module, tell me where I can ftp it, and I'll include its ioctls in my next release.

MAIN TABLE


<include/asm-i386/socket.h>

0x00008901 FIOSETOWN const int *
0x00008902 SIOCSPGRP const int *
0x00008903 FIOGETOWN int *
0x00008904 SIOCGPGRP int *
0x00008905 SIOCATMARK int *
0x00008906 SIOCGSTAMP timeval *

<include/asm-i386/termios.h>

0x00005401 TCGETS struct termios *
0x00005402 TCSETS const struct termios *
0x00005403 TCSETSW const struct termios *
0x00005404 TCSETSF const struct termios *
0x00005405 TCGETA struct termio *
0x00005406 TCSETA const struct termio *
0x00005407 TCSETAW const struct termio *
0x00005408 TCSETAF const struct termio *
0x00005409 TCSBRK int
0x0000540A TCXONC int
0x0000540B TCFLSH int
0x0000540C TIOCEXCL void
0x0000540D TIOCNXCL void
0x0000540E TIOCSCTTY int
0x0000540F TIOCGPGRP pid_t *
0x00005410 TIOCSPGRP const pid_t *

Previous | Table of Contents | Next