Previous | Table of Contents | Next

Page 877

termios, tcgetattr, tcsetattr, tcsendbreak, tcdrain, tcflush, tcflow, cfgetospeed, cfgetispeed, cfsetispeed, cfsetospeed, tcgetpgrp, tcsetpgrp

The default on open of a terminal file is that neither its input nor its output is suspended.

The baud rate functions are provided for getting and setting the values of the input and output baud rates in the termios structure. The new values do not take effect until tcsetattr() is successfully called.

Setting the speed to B0 instructs the modem to hang up. The actual bit rate corresponding to B38400 may be altered with setserial(8).

The input and output baud rates are stored in the termios structure.

cfgetospeed() returns the output baud rate stored in the termios structure pointed to by termios_p.

cfsetospeed() sets the output baud rate stored in the termios structure pointed to by termios_p to speed, which must be one of these constants:

B0

B50

B75

B110

B134

B150

B200

B300

B600

B1200

B1800

B2400

B4800

B9600

B19200

B38400

B57600

B115200

B230400

The zero baud rate, B0, is used to terminate the connection. If B0 is specified, the modem control lines will no longer be asserted. Normally, this will disconnect the line. CBAUDEX is a mask for the speeds beyond those defined in POSIX.1 (57600 and later). Thus, B57600 & CBAUDEX is nonzero.

cfgetispeed() returns the input baud rate stored in the termios structure.

cfsetispeed() sets the input baud rate stored in the termios structure to speed. If the input baud rate is set to 0, it will be equal to the output baud rate.

tcgetpgrp() returns the process group ID of the foreground processing group, or -1 on error.

tcsetpgrp() sets the process group ID to pgrpid. pgrpid must be the ID of a process group in the same session.

RETURN VALUES

cfgetispeed() returns the input baud rate stored in the termios structure.

cfgetospeed() returns the output baud rate stored in the termios structure.

tcgetpgrp() returns the process group ID of foreground processing group, or -1 on error.

All other functions return

Page 878

-1 on failure (and set errno to indicate the error).

SEE ALSO

setserial(8)

Linux, 25 February 1995

time

time—Gets time in seconds

SYPNOSIS

#include <time.h>
time_t time(time_t *t);

DESCRIPTION

time returns the time since 00:00:00 GMT, January 1, 1970, measured in seconds.

If t is non null, the return value is also stored in the memory pointed to by t.

CONFORMS TO

SVID, AT&T, POSIX, X/OPEN, BSD 4.3

(Under BSD 4.3, this call is made obsolete by gettimeofday(2).)

SEE ALSO

ctime(3), date(1), ftime(3), gettimeofday(2)

Linux, 24 July 1993

times

times—Gets process times

SYPNOSIS

#include <sys/times.h> clock_t times(struct tms *buf);

DESCRIPTION

times stores the current process times in buf.

struct tms is as defined in /usr/include/sys/times.h:

struct  tms  {
             time_t tms_utime;  /* user time */
             time_t tms_stime;  /* system time */
             time_t tms_cutime; /* user time of children */
             time_t tms_cstime; /* system time of children */
             };

times returns the number of clock ticks that have elapsed since the system has been up.

Previous | Table of Contents | Next

1