and the function return type.
There are seven macros that make the actual call into the system easier.
They have the form:
-.sp
-.RS
+.PP
+.in +4n
+.EX
.RI _syscall X ( type , name , type1 , arg1 , type2 , arg2 ,...)
-.RE
+.EE
+.in
.PP
where
.IP
__u32 inheritable;
} *cap_user_data_t;
.EE
-.in -4n
+.in
.PP
The
.IR effective ,
filesystem.
For example, the following command
displays a list of all schedulers currently loaded in the kernel:
-.sp
-.RS
-.nf
+.PP
+.in +4n
+.EX
.RB "$" " cat /sys/block/sda/queue/scheduler"
noop anticipatory deadline [cfq]
-.fi
-.RE
-.sp
+.EE
+.in
+.PP
The scheduler surrounded by brackets is the one actually
in use for the device
.RI ( sda
.I sda
device to
.IR cfq :
-.sp
-.RS
-.nf
+.PP
+.in +4n
+.EX
.RB "$" " su"
Password:
.RB "#" " echo cfq > /sys/block/sda/queue/scheduler"
-.fi
-.RE
+.EE
+.in
+.\"
.SS The Completely Fair Queuing (CFQ) I/O scheduler
Since version 3 (also known as CFQ Time Sliced), CFQ implements
I/O nice levels similar to those
.SH DESCRIPTION
Each semaphore in a System\ V semaphore set
has the following associated values:
-.sp
+.PP
.in +4n
.nf
unsigned short semval; /* semaphore value */
unsigned short semzcnt; /* # waiting for zero */
unsigned short semncnt; /* # waiting for increase */
pid_t sempid; /* PID of process that last
- modified semaphore value */
-.sp
.in -4n
.fi
+.PP
.BR semop ()
performs operations on selected semaphores in the set indicated by
.IR semid .
unsigned short sem_num; /* semaphore number */
short sem_op; /* semaphore operation */
short sem_flg; /* operation flags */
-.in -4n
+.in
.fi
.PP
Flags recognized in
the path prefix.
(See
.BR path_resolution (7).)
-.sp
+.IP
(For UDP sockets) An attempt was made to send to a
network/broadcast address as though it was a unicast address.
.TP
.PP
.in +4n
.EX
-.sp
const char *tm_zone; /* Timezone abbreviation */
.EE
.in
.SH DESCRIPTION
The function returns 365 for a normal year and 366 for a leap year.
The calculation for leap year is based on:
-.sp
+.PP
+.in +4n
+.EX
(year) %4 == 0 && ((year) %100 != 0 || (year) %400 == 0)
-.sp
+.EE
+.in
+.PP
The formula is defined in the macro
.I __isleap(year)
also found in
to set individual floating-point traps, and
.BR fegetexcept ()
to query the state.
-.sp
+.PP
.nf
+.EX
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
-.br
.B "#include <fenv.h>"
.sp
.BI "int feenableexcept(int " excepts );
-.br
.BI "int fedisableexcept(int " excepts );
-.br
.B "int fegetexcept(void);"
-.br
+.EE
.fi
-.LP
+.PP
The
.BR feenableexcept ()
and
The
.I classification
argument is the sum of values describing 4 types of information.
-.br
-.sp
+.PP
The first value defines the output channel.
.TP 12n
.B MM_PRINT
If the user puts
.B SEV_LEVEL
with a format like
-.sp
+.PP
.RS
SEV_LEVEL=[description[:description[:...]]]
.RE
-.sp
+.PP
in the environment of the process before the first call to
.BR fmtmsg (),
where each description is of the form
-.sp
+.PP
.RS
severity-keyword,level,printstring
.RE
-.sp
+.PP
then
.BR fmtmsg ()
will also accept the indicated values for the level (in addition to
POSIX.1-2001, POSIX.1-2008.
.SH NOTES
On some ancient systems, the prototype was:
-.sp
-.RS
+.PP
+.in +4n
+.EX
.BI "key_t ftok(char *" pathname ", char " proj_id );
-.RE
+.EE
+.in
.PP
Today,
.I proj_id
If set, do not follow symbolic links.
(This is what you want.)
If not set, symbolic links are followed, but no file is reported twice.
-.sp
+.IP
If \fBFTW_PHYS\fP is not set, but \fBFTW_DEPTH\fP is set,
then the function
.IR fn ()
char *ai_canonname;
struct addrinfo *ai_next;
};
-.fi
.in
+.fi
.PP
The
.I hints
.BR getpwnam_r (3).
Other systems use the prototype
.sp
-.nf
.in +4n
+.nf
struct group *getgrent_r(struct group *grp, char *buf,
int buflen);
-.in
.fi
+.in
.sp
or, better,
.sp
-.nf
.in +4n
+.nf
int getgrent_r(struct group *grp, char *buf, int buflen,
FILE **gr_fp);
-.in
.fi
+.in
.SH NOTES
The function
.BR getgrent_r ()
is not really reentrant since it shares the reading position
in the stream with all other threads.
.SH EXAMPLE
-.nf
+.EX
#define _GNU_SOURCE
#include <grp.h>
#include <stdio.h>
endgrent();
exit(EXIT_SUCCESS);
}
-.fi
+.EE
.\" perhaps add error checking - should use strerror_r
.\" #include <errno.h>
.\" #include <stdlib.h>
.sp
.in +4n
.nf
-.ne 7
struct hostent {
char *h_name; /* official name of host */
char **h_aliases; /* alias list */
declared in
.I <getopt.h>
as
+.PP
.in +4n
.nf
-.sp
struct option {
const char *name;
int has_arg;
with no associated value; and
.IR "\-t val" ,
which expects an associated value.
-.nf
-.sp
+.PP
+.EX
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
exit(EXIT_SUCCESS);
}
-.fi
+.EX
.SS getopt_long()
The following example program illustrates the use of
.BR getopt_long ()
with most of its features.
-.nf
-.sp
+.PP
+.EE
#include <stdio.h> /* for printf */
#include <stdlib.h> /* for exit */
#include <getopt.h>
exit(EXIT_SUCCESS);
}
-.fi
+.EE
.SH SEE ALSO
.BR getopt (1),
.BR getsubopt (3)
function reconstructs the password line entry for
the given user ID \fIuid\fP in the buffer \fIbuf\fP.
The returned buffer contains a line of format
-.sp
-.RS
+.PP
+.in +4n
+.EE
.B name:passwd:uid:gid:gecos:dir:shell
-.RE
+.EE
+.in
.PP
The \fIpasswd\fP structure is defined in \fI<pwd.h>\fP as follows:
.sp
.BR getpwnam_r (3).
Other systems use the prototype
.sp
-.nf
.in +4n
+.nf
struct passwd *
getpwent_r(struct passwd *pwd, char *buf, int buflen);
-.in
.fi
+.in
.sp
or, better,
.sp
is not really reentrant since it shares the reading position
in the stream with all other threads.
.SH EXAMPLE
-.nf
+.EX
#define _GNU_SOURCE
#include <pwd.h>
#include <stdio.h>
endpwent();
exit(EXIT_SUCCESS);
}
-.fi
+.EE
.\" perhaps add error checking - should use strerror_r
.\" #include <errno.h>
.\" #include <stdlib.h>
The following is an example of the kind of string
that might be passed in
.IR optionp :
-.sp
+.PP
.in +4n
+.EX
.B ro,name=xyz
+.EE
.in
.PP
The
All these functions are obsolete now on non-Linux systems.
POSIX.1-2001 and POSIX.1-2008, following SUSv1,
does not have any of these functions, but instead uses
-.sp
+.PP
+.in +4n
+.EX
.B #include <utmpx.h>
-.sp
+.PP
.B struct utmpx *getutxent(void);
-.br
.B struct utmpx *getutxid(const struct utmpx *);
-.br
.B struct utmpx *getutxline(const struct utmpx *);
-.br
.B struct utmpx *pututxline(const struct utmpx *);
-.br
.B void setutxent(void);
-.br
.B void endutxent(void);
+.EE
+.in
.PP
These functions are provided by glibc,
and perform the same task as their equivalents without the "x", but use
.SS Glibc notes
The above functions are not thread-safe.
Glibc adds reentrant versions
-.sp
-.nf
+.PP
+.in +4n
+.EX
.B #include <utmp.h>
-.sp
+.PP
.BI "int getutent_r(struct utmp *" ubuf ", struct utmp **" ubufp );
-.sp
+.PP
.BI "int getutid_r(struct utmp *" ut ,
.BI " struct utmp *" ubuf ", struct utmp **" ubufp );
-.sp
+.PP
.BI "int getutline_r(struct utmp *" ut ,
.BI " struct utmp *" ubuf ", struct utmp **" ubufp );
-.fi
-.sp
-.in -4n
+.EE
+.in
+.PP
Feature Test Macro Requirements for glibc (see
.BR feature_test_macros (7)):
.in
One example of use is the following code, which simulates typing
.sp
.in +4n
+.EX
ls \-l *.c ../*.c
+.EE
.in
.sp
in the shell:
structure contains at least the following entries:
.sp
.in +4n
-.nf
- unsigned int if_index; /* Index of interface (1, 2, ...) */
- char *if_name; /* Null-terminated name ("eth0", etc.) */
-.fi
+.EX
+unsigned int if_index; /* Index of interface (1, 2, ...) */
+char *if_name; /* Null-terminated name ("eth0", etc.) */
+.EE
.in
.PP
The
as:
.sp
.in +4n
-.nf
+.EX
typedef uint32_t in_addr_t;
struct in_addr {
in_addr_t s_addr;
};
-.fi
+.EE
.in
.SH ATTRIBUTES
For an explanation of the terms used in this section, see
.BR _llseek (2).
.SS lseek()
Prototype:
-.nf
-.sp
+.PP
.in +4n
+.EX
.BI "off_t lseek(int " fd ", off_t " offset ", int " whence );
+.EE
.in
-.fi
-.sp
+.PP
.BR lseek (2)
uses the type
.IR off_t .
This is a 32-bit signed type on 32-bit architectures, unless one
compiles with
-.nf
-.sp
+.PP
.in +4n
+.EX
#define _FILE_OFFSET_BITS 64
+.EE
.in
-.sp
-.fi
+.PP
in which case it is a 64-bit signed type.
.SS lseek64()
Prototype:
-.nf
-.sp
+.PP
.in +4n
+.EX
.BI "off64_t lseek64(int " fd ", off64_t " offset ", int " whence );
+.EE
.in
-.fi
-.sp
+.PP
The library routine
.BR lseek64 ()
uses a 64-bit type even when
Its prototype (and the type
.IR off64_t )
is available only when one compiles with
-.nf
-.sp
+.PP
.in +4n
+.EX
#define _LARGEFILE64_SOURCE
+.EE
.in
-.sp
-.fi
+.PP
The function
.BR lseek64 ()
.\" in glibc 2.0.94, not in 2.0.6
.BR llseek ().
.SS llseek()
Prototype:
-.nf
-.sp
+.PP
.in +4n
+.EX
.BI "loff_t llseek(int " fd ", loff_t " offset ", int " whence );
+.EE
.in
-.fi
-.sp
+.PP
The type
.I loff_t
is a 64-bit signed type.
When users complained about data loss caused by a miscompilation of
.BR e2fsck (8),
glibc 2.1.3 added the link-time warning
-.sp
+.PP
.in +4n
"the \`llseek\' function may be dangerous; use \`lseek64\' instead."
.in
-.sp
+.PP
This makes this function unusable if one desires a warning-free
compilation.
.SS _llseek()
On 32-bit architectures,
this is the system call that is used to implement all of the above functions.
The prototype is:
-.nf
-.sp
+.PP
.in +4n
+.EX
.BI "int _llseek(int " fd ", off_t " offset_hi ", off_t " offset_lo ,
.BI " loff_t *" result ", int " whence );
+.EE
.in
-.fi
-.sp
+.PP
For more details, see
.BR llseek (2).
.PP
by defining and exporting functions such as "malloc" and "free".
.SH EXAMPLE
Here is a short example of how to use these variables.
-.sp
-.nf
+.PP
+.EX
#include <stdio.h>
#include <malloc.h>
return result;
}
-.fi
+.EX
.SH SEE ALSO
.BR mallinfo (3),
.BR malloc (3),
.I a
can be initialized to the initial state
by zeroing it, for example using
-.sp
+.PP
.in +4n
+.EE
memset(&a, 0, sizeof(a));
+.EE
.in
.SH RETURN VALUE
The
.BR mkostemp ():
The last six characters of \fItemplate\fP were not XXXXXX;
now \fItemplate\fP is unchanged.
-.sp
+.IP
For
.BR mkstemps ()
and
time_t tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
};
-
.fi
.in
+.PP
If no message is available,
and the timeout has already expired by the time of the call,
.BR mq_timedreceive ()
This value is an absolute timeout in seconds and nanoseconds
since the Epoch, 1970-01-01 00:00:00 +0000 (UTC),
specified in the following structure:
-.sp
+.PP
.in +4n
.nf
struct timespec {
time_t tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
};
-
.fi
.in
+.PP
If the message queue is full,
and the timeout has already expired by the time of the call,
.BR mq_timedsend ()
command is executed in the child, and the
.BR posix_spawn ()
call employs no file actions or attributes objects.
-.sp
+.PP
.in +4
-.nf
+.EX
$ \fB./a.out date\fP
PID of child: 7634
Tue Feb 1 19:47:50 CEST 2011
Child status: exited, status=0
-.fi
+.EE
.in
-.sp
+.PP
In the next run, the
.I \-c
command-line option is used to create a file actions object that closes
Consequently,
.BR date (1)
fails when trying to perform output and exits with a status of 1.
-.sp
+.PP
.in +4
-.nf
+.EX
$ \fB./a.out -c date\fP
PID of child: 7636
date: write error: Bad file descriptor
Child status: exited, status=1
-.fi
+.EE
.in
-.sp
+.PP
In the next run, the
.I \-s
command-line option is used to create an attributes object that
is necessary
.RB ( SIGKILL
can't be blocked).
-.sp
+.PP
.in +4
-.nf
+.EX
$ \fB./a.out -s sleep 60 &\fP
[1] 7637
$ PID of child: 7638
$ \fBkill -KILL 7638\fP
$ Child status: killed by signal 9
[1]+ Done ./a.out -s sleep 60
-.fi
+.EE
.in
-.sp
+.PP
When we try to execute a nonexistent command in the child, the
.BR exec (3)
fails and the child exits with a status of 127.
-.sp
+.PP
.in +4
-.nf
+.EX
$ \fB./a.out xxxxx
PID of child: 10190
Child status: exited, status=127
-.fi
+.EE
.in
.SS Program source
.EX
is defined as follows:
.sp
.in +4n
-.nf
+.EX
struct group {
char *gr_name; /* group name */
char *gr_passwd; /* group password */
gid_t gr_gid; /* group ID */
char **gr_mem; /* group members */
};
-.fi
+.EE
.in
.SH RETURN VALUE
The function returns zero on success, and a nonzero value on error.
The \fIpasswd\fP structure is defined in \fI<pwd.h>\fP as follows:
.sp
.in +4n
-.nf
+.EX
struct passwd {
char *pw_name; /* username */
char *pw_passwd; /* user password */
char *pw_dir; /* home directory */
char *pw_shell; /* shell program */
};
-.fi
+.EE
.in
.SH RETURN VALUE
The
.PP
Another example is the following program,
which sorts the strings given in its command-line arguments:
-.sp
-.nf
+.PP
+.EX
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
puts(argv[j]);
exit(EXIT_SUCCESS);
}
-.fi
+.EE
.SH SEE ALSO
.BR sort (1),
.BR alphasort (3),
.BR raise ()
function sends a signal to the calling process or thread.
In a single-threaded program it is equivalent to
-.sp
+.PP
.in +4n
-.nf
+.EX
kill(getpid(), sig);
-.fi
+.EE
.in
.PP
In a multithreaded program it is equivalent to
-.sp
+.PP
.in +4n
-.nf
+.EX
pthread_kill(pthread_self(), sig);
-.fi
+.EE
.in
.PP
If the signal causes a handler to be called,
possibly useful when one needs the same sequence on two different machines.
.sp
.in +4n
-.nf
+.EX
static unsigned long next = 1;
/* RAND_MAX assumed to be 32767 */
void mysrand(unsigned int seed) {
next = seed;
}
-.fi
+.EE
.in
.PP
The following program can be used to display the
pseudo-random sequence produced by
.BR rand ()
when given a particular seed.
+.PP
.in +4n
-.nf
-
+.EX
#include <stdlib.h>
#include <stdio.h>
exit(EXIT_SUCCESS);
}
-.fi
+.EX
.in
.SH SEE ALSO
.BR drand48 (3),
The program connects to a computer called "linux".
Using "localhost" does not work.
The result is the localtime of the computer "linux".
-.sp
-.nf
+.PP
+.EX
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
exit(EXIT_SUCCESS);
}
-.fi
+.EE
.SH SEE ALSO
.\" .BR netdate (1),
.BR ntpdate (1),
The following example compiles with
.IR "gcc example.c \-o example" .
It will dump all names in the alias database.
-.sp
-.nf
+.PP
+.EX
#include <aliases.h>
#include <stdio.h>
#include <stdlib.h>
endaliasent();
exit(EXIT_SUCCESS);
}
-.fi
+.EE
.SH SEE ALSO
.BR getgrent (3),
.BR getpwent (3),
.I stream
is closed, which also happens at program termination.
For example, the following is invalid:
-.nf
-.sp
+.PP
+.EX
#include <stdio.h>
int
printf("Hello, world!\\n");
return 0;
}
-.fi
+.PP
.SH SEE ALSO
.BR stdbuf (1),
.BR fclose (3),
.BR open (2).
(Symbolic definitions of these constants can be obtained by including
.IR <sys/stat.h> .)
-.sp
+.IP
A new shared memory object initially has zero length\(emthe size of the
object can be set using
.BR ftruncate (2).
.I x
scaled to the range [1,2).
They are equivalent to
-.sp
+.PP
.in +4n
+.EX
scalb(x, (double) \-ilogb(x))
+.EE
.in
.PP
This function exists mainly for use in certain standardized tests
or a pointer value) to be sent with the signal, and has the following type:
.sp
.in +4n
-.nf
+.EX
union sigval {
int sival_int;
void *sival_ptr;
};
-.fi
+.EE
.in
.PP
If the receiving process has installed a handler for this signal using the
.IR /proc/mounts .
.PP
The glibc implementations of
-.sp
-.nf
- pathconf(path, _PC_REC_XFER_ALIGN);
- pathconf(path, _PC_ALLOC_SIZE_MIN);
- pathconf(path, _PC_REC_MIN_XFER_SIZE);
-.fi
-.sp
+.PP
+.in +4n
+.EX
+pathconf(path, _PC_REC_XFER_ALIGN);
+pathconf(path, _PC_ALLOC_SIZE_MIN);
+pathconf(path, _PC_REC_MIN_XFER_SIZE);
+.EE
+.in
+.PP
respectively use the
.IR f_frsize ,
.IR f_frsize ,
.BR strfroml ()
functions are equivalent to
.PP
- snprintf(str, n, format, fp);
+.in +4n
+.EX
+snprintf(str, n, format, fp);
+.EE
+.in
.PP
except for the
.I format
\^ Asynchronous signal safety AS-Unsafe heap
\^ Asynchronous cancellation safety AC-Unsafe mem
.TE
-.sp
+.sp 1
Note: these attributes are preliminary.
.SH CONFORMING TO
C99, ISO/IEC TS 18661-1.
notation, resulting in "12.100000":
.sp
.in +4
-.nf
+.EX
#define __STDC_WANT_IEC_60559_BFP_EXT__
#include <stdlib.h>
int ssize = 10;
char s[ssize];
strfromf(s, ssize, "%f", 12.1);
-.fi
+.EE
.in
.sp
To convert the value 12.3456 as a float type to a string using
decimal notation with two digits of precision, resulting in "12.35":
.sp
.in +4
-.nf
+.EX
#define __STDC_WANT_IEC_60559_BFP_EXT__
#include <stdlib.h>
int ssize = 10;
char s[ssize];
strfromf(s, ssize, "%.2f", 12.3456);
-.fi
+.EE
.in
.sp
To convert the value 12.345e19 as a double type to a string using
scientific notation with zero digits of precision, resulting in "1E+20":
.sp
.in +4
-.nf
+.EX
#define __STDC_WANT_IEC_60559_BFP_EXT__
#include <stdlib.h>
int ssize = 10;
char s[ssize];
strfromd(s, ssize, "%.E", 12.345e19);
-.fi
+.EE
.in
.SH SEE ALSO
.BR atof (3),
as follows:
.sp
.in +4n
-.nf
+.EX
struct tm {
int tm_sec; /* Seconds (0-60) */
int tm_min; /* Minutes (0-59) */
int tm_yday; /* Day in the year (0-365, 1 Jan = 0) */
int tm_isdst; /* Daylight saving time */
};
-.fi
+.EE
.in
.PP
For more details on the
and
.BR strftime (3).
.sp
-.nf
+.EX
#define _XOPEN_SOURCE
#include <stdio.h>
#include <stdlib.h>
puts(buf);
exit(EXIT_SUCCESS);
}
-.fi
+.EE
.SH SEE ALSO
.BR time (2),
.BR getdate (3),
BSD also has
.sp
.in +4n
-.nf
+.EX
.BI "quad_t strtoq(const char *" nptr ", char **" endptr ", int " base );
-.sp
+.EX
.in
.fi
with completely analogous definition.
supported.)
.LP
BSD also has
-.sp
+.PP
.in +4n
-.nf
+.EX
.BI "u_quad_t strtouq(const char *" nptr ", char **" endptr ", int " base );
-.sp
-.in -4n
-.fi
+.EE
+.in
+.PP
with completely analogous definition.
Depending on the wordsize of the current architecture, this
may be equivalent to
This structure contains at least the following members:
.sp
.in +4n
-.nf
+.EX
tcflag_t c_iflag; /* input modes */
tcflag_t c_oflag; /* output modes */
tcflag_t c_cflag; /* control modes */
tcflag_t c_lflag; /* local modes */
cc_t c_cc[NCCS]; /* special characters */
-.fi
+.EE
.in
.PP
The values that may be assigned to these fields are described below.
.B _BSD_SOURCE
or
.BR _SVID_SOURCE ]
-.sp
+.IP
(POSIX says that the baud speed is stored in the
.I termios
structure without specifying where precisely, and provides
.IR x .
.PP
The Gamma function is defined by
-.sp
- Gamma(x) = integral from 0 to infinity of t^(x\-1) e^\-t dt
-.sp
+.PP
+.RS
+Gamma(x) = integral from 0 to infinity of t^(x\-1) e^\-t dt
+.RE
+.PP
It is defined for every real number except for nonpositive integers.
For nonnegative integral
.I m
one has
-.sp
- Gamma(m+1) = m!
-.sp
+.PP
+.RS
+Gamma(m+1) = m!
+.RE
+.PP
and, more generally, for all
.IR x :
-.sp
- Gamma(x+1) = x * Gamma(x)
-.sp
+.PP
+.RS
+Gamma(x+1) = x * Gamma(x)
+.RE
+.PP
Furthermore, the following is valid for all values of
.I x
outside the poles:
-.sp
- Gamma(x) * Gamma(1 \- x) = PI / sin(PI * x)
+.PP
+.RS
+Gamma(x) * Gamma(1 \- x) = PI / sin(PI * x)
.PP
.SH RETURN VALUE
On success, these functions return Gamma(x).
as:
.sp
.in +4n
-.nf
+.EX
struct timeval {
time_t tv_sec; /* seconds */
suseconds_t tv_usec; /* microseconds */
};
-.fi
+.EE
.in
.PP
.BR timeradd ()
The following program inserts twelve random numbers into a binary
tree, where duplicate numbers are collapsed, then prints the numbers
in order.
-.sp
-.nf
+.PP
+.EX
#define _GNU_SOURCE /* Expose declaration of tdestroy() */
#include <search.h>
#include <stdlib.h>
tdestroy(root, free);
exit(EXIT_SUCCESS);
}
-.fi
+.EE
.SH SEE ALSO
.BR bsearch (3),
.BR hsearch (3),
can be one of two formats.
The first format is a string of characters that directly represent the
timezone to be used:
-.sp
-.RS
+.PP
+.in +4n
+.EX
.IR "std offset" [ dst [ offset ][, start [ /time ], end [ /time ]]]
-.RE
-.sp
+.EE
+.in
+.PP
There are no spaces in the specification.
The \fIstd\fP string specifies an abbreviation for the timezone and must be
three or more alphabetic characters.
if the local timezone is west of the Prime Meridian and negative if it is
east.
The hour must be between 0 and 24, and the minutes and seconds 00 and 59:
-.sp
-.RS
+.PP
+.in +4n
+.EX
.RI [ + | - ] hh [ :mm [ :ss ]]
-.RE
+.EE
+.in
.PP
The \fIdst\fP string and \fIoffset\fP specify the name and offset for the
corresponding daylight saving timezone.
and daylight saving time (NZDT), 13 hours ahead of UTC,
runs from the first Sunday in October to the third Sunday in March,
and the changeovers happen at the default time of 02:00:00:
-.nf
-
- TZ="NZST-12:00:00NZDT-13:00:00,M10.1.0,M3.3.0"
-.fi
+.in +4n
+.EX
+TZ="NZST-12:00:00NZDT-13:00:00,M10.1.0,M3.3.0"
+.EE
+.in
.PP
The second format specifies that the timezone information should be read
from a file:
-.sp
-.RS
+.PP
+.in +4n
+.EX
:[filespec]
-.RE
-.sp
+.EE
+.in
+.PP
If the file specification \fIfilespec\fP is omitted, or its value cannot
be interpreted, then Coordinated Universal Time (UTC) is used.
If \fIfilespec\fP is given, it specifies another
of the above \fBTZ\fP formats will be tried.
.PP
Here's an example, once more for New Zealand:
-.nf
-
- TZ=":Pacific/Auckland"
-.fi
+.PP
+.in +4n
+.EX
+TZ=":Pacific/Auckland"
+.EE
+.in
.SH ENVIRONMENT
.TP
.B TZ
For consistency with the other "utmpx" functions (see
.BR getutxent (3)),
glibc provides (since version 2.1):
-.nf
-.sp
+.PP
+.in +4n
+.EX
.B #include <utmpx.h>
-.sp
.BI "void updwtmpx (const char *" wtmpx_file ", const struct utmpx *" utx );
-.fi
+.EE
+.in
.PP
This function performs the same task as
.BR updwtmp (),
Programs will be more portable
if they never mention this type explicitly.
Use
+.PP
.in +4n
-.nf
-.sp
+.EX
#include <unistd.h>
\&...
unsigned int usecs;
\&...
usleep(usecs);
-.fi
+.EE
.in
.LP
The interaction of this function with the
.BR ualarm (3)
is unspecified.
.SH SEE ALSO
-.BR alarm (2),
+BR alarm (2),
.BR getitimer (2),
.BR nanosleep (2),
.BR select (2),
the operation.
.SH EXAMPLE
The following code loops over the tokens contained in a wide-character string.
-.sp
-.nf
+.PP
+.EX
wchar_t *wcs = ...;
wchar_t *token;
wchar_t *state;
token = wcstok(NULL, " \\t\\n", &state)) {
...
}
-.fi
+.EE
.SH SEE ALSO
.BR strtok (3),
.BR wcschr (3)
glyph at the current cursor location) on the Linux console.
.PP
.B "Control characters"
-.sp
+.PP
A character is a control character if (before transformation
according to the mapping table) it has one of the 14 codes
00 (NUL), 07 (BEL), 08 (BS), 09 (HT), 0a (LF), 0b (VT),
.TE
.PP
.B "ECMA-48 CSI sequences"
-.sp
+.PP
CSI (or ESC [) is followed by a sequence of parameters,
at most NPAR (16), that are decimal numbers separated by
semicolons.
.TE
.PP
.B ECMA-48 Set Graphics Rendition
-.sp
+.PP
The ECMA-48 SGR sequence ESC [ \fIparameters\fP m sets display
attributes.
Several attributes can be set in the same sequence, separated by
.\"
.PP
.B DEC Private Mode (DECSET/DECRST) sequences
-.sp
+.PP
.\"
These are not described in ECMA-48.
We list the Set Mode sequences;
.\"
.PP
.B Linux Console Private CSI Sequences
-.sp
+.PP
.\"
The following sequences are neither ECMA-48 nor native VT102.
They are native to the Linux console driver.
.\"
.PP
.B Control-character handling
-.sp
+.PP
The VT102 also recognized the following control characters:
.HP
NUL (0x00) was ignored;
.\"
.PP
.B Escape sequences
-.sp
+.PP
VT100 console sequences not implemented on the Linux console:
.TS
l l l.
.\"
.PP
.B CSI Sequences
-.sp
+.PP
Old versions of \fBxterm\fP(1), for example, from X11R5,
interpret the blink SGR as a bold SGR.
Later versions which implemented ANSI colors, for example,
refers to the third DOS "primary" partition on the second one.
.LP
They are typically created by:
-.RS
-.sp
+.PP
+.in +4n
+.EX
mknod \-m 660 /dev/hda b 3 0
-.br
mknod \-m 660 /dev/hda1 b 3 1
-.br
mknod \-m 660 /dev/hda2 b 3 2
-.br
\&...
-.br
mknod \-m 660 /dev/hda8 b 3 8
-.br
mknod \-m 660 /dev/hdb b 3 64
-.br
mknod \-m 660 /dev/hdb1 b 3 65
-.br
mknod \-m 660 /dev/hdb2 b 3 66
-.br
\&...
-.br
mknod \-m 660 /dev/hdb8 b 3 72
-.br
chown root:disk /dev/hd*
-.RE
+.EE
+.in
.SH FILES
/dev/hd*
.SH SEE ALSO
The
.B hpsa
driver supports the following Smart Array boards:
+.PP
.nf
-
Smart Array P700M
Smart Array P212
Smart Array P410
.IP
For example:
.IP
-.nf
- # \fBcd /sys/class/scsi_host/host4\fP
- # \fBcat firmware_revision\fP
- 7.14
-.fi
+.in +4n
+.EX
+# \fBcd /sys/class/scsi_host/host4\fP
+# \fBcat firmware_revision\fP
+7.14
+.EE
+.in
+.\"
.SS HPSA-specific disk attribute files in /sys
.TP
.I /sys/class/scsi_disk/c:b:t:l/device/unique_id
This attribute contains a 32 hex-digit unique ID for each logical drive.
-.nf
-
+.IP
For example:
-
- # \fBcd /sys/class/scsi_disk/4:0:0:0/device\fP
- # \fBcat unique_id\fP
- 600508B1001044395355323037570F77
-.fi
+.IP
+.in +4n
+.EX
+# \fBcd /sys/class/scsi_disk/4:0:0:0/device\fP
+# \fBcat unique_id\fP
+600508B1001044395355323037570F77
+.EE
+.in
.TP
.I /sys/class/scsi_disk/c:b:t:l/device/raid_level
This attribute contains the RAID level of each logical drive.
-.nf
-
+.IP
For example:
-
- # \fBcd /sys/class/scsi_disk/4:0:0:0/device\fP
- # \fBcat raid_level\fP
- RAID 0
-.fi
+.IP
+.in +4n
+.EX
+# \fBcd /sys/class/scsi_disk/4:0:0:0/device\fP
+# \fBcat raid_level\fP
+RAID 0
+.EE
+.in
.TP
.I /sys/class/scsi_disk/c:b:t:l/device/lunid
This attribute contains the 16 hex-digit (8 byte) LUN ID
by which a logical drive or physical device can be addressed.
.IR c : b : t : l
are the controller, bus, target, and lun of the device.
-.nf
-
+.PP
For example:
-
- # \fBcd /sys/class/scsi_disk/4:0:0:0/device\fP
- # \fBcat lunid\fP
- 0x0000004000000000
-.fi
+.IP
+.in +4n
+.EX
+# \fBcd /sys/class/scsi_disk/4:0:0:0/device\fP
+# \fBcat lunid\fP
+0x0000004000000000
+.EE
+.in
+.\"
.SS Supported ioctl() operations
For compatibility with applications written for the
.BR cciss (4)
.TP
.B CCISS_GETDRIVVER
Returns driver version in three bytes encoded as:
-.sp
- (major_version << 16) | (minor_version << 8) |
- (subminor_version)
+.IP
+.in +4n
+.EX
+(major_version << 16) | (minor_version << 8) |
+ (subminor_version)
+.EE
+.in
.TP
.BR CCISS_PASSTHRU ", " CCISS_BIG_PASSTHRU
Allows "BMIC" and "CISS" commands to be passed through to the Smart Array.
memory-mapped PCI regions is.
.LP
It is typically created by:
-.RS
-.sp
+.PP
+.in +4n
+.EX
mknod \-m 660 /dev/mem c 1 1
-.br
chown root:kmem /dev/mem
-.RE
-.LP
+.EE
+.in
+.PP
The file
.IR /dev/kmem
is the same as
kernel configuration option is enabled.
.LP
It is typically created by:
-.RS
-.sp
+.PP
+.in +4n
+.EX
mknod \-m 640 /dev/kmem c 1 2
-.br
chown root:kmem /dev/kmem
-.RE
-.LP
+.EE
+.in
+.PP
.IR /dev/port
is similar to
.IR /dev/mem ,
but the I/O ports are accessed.
.LP
It is typically created by:
-.RS
-.sp
+.PP
+.in +4n
+.EX
mknod \-m 660 /dev/port c 1 4
-.br
chown root:kmem /dev/port
-.RE
+.EE
+.in
.SH FILES
.I /dev/mem
.br
always return bytes containing zero (\(aq\e0\(aq characters).
.LP
These devices are typically created by:
-.RS
-.sp
+.PP
+.in +4n
+.EX
mknod \-m 666 /dev/null c 1 3
-.br
mknod \-m 666 /dev/zero c 1 5
-.br
chown root:root /dev/null /dev/zero
-.RE
+.EE
+.in
.SH FILES
.I /dev/null
.br
device is a block device to access the ram disk in raw mode.
.LP
It is typically created by:
-.RS
-.sp
+.PP
+.in +4n
+.EX
mknod \-m 660 /dev/ram b 1 1
-.br
chown root:disk /dev/ram
-.RE
+.EE
+.in
.SH FILES
/dev/ram
.SH SEE ALSO
is the number of the physical drive in order of detection, and
.I partition_number
is as follows:
-.sp
+.IP +3
partition 0 is the whole drive
-.br
+.IP
partitions 1-4 are the DOS "primary" partitions
-.br
+.IP
partitions 5-8 are the DOS "extended" (or "logical") partitions
.PP
For example,
.TP
.B HDIO_GETGEO
Returns the BIOS disk parameters in the following structure:
+.PP
.in +4n
-.nf
-
+.EX
struct hd_geometry {
unsigned char heads;
unsigned char sectors;
unsigned short cylinders;
unsigned long start;
};
-.fi
+.EE
.in
.IP
A pointer to this structure is passed as the
are character devices for the serial terminal lines.
.LP
They are typically created by:
-.RS
-.sp
+.PP
+.in +4n
+.EX
mknod \-m 660 /dev/ttyS0 c 4 64 # base address 0x3f8
-.br
mknod \-m 660 /dev/ttyS1 c 4 65 # base address 0x2f8
-.br
mknod \-m 660 /dev/ttyS2 c 4 66 # base address 0x3e8
-.br
mknod \-m 660 /dev/ttyS3 c 4 67 # base address 0x2e8
-.br
chown root:tty /dev/ttyS[0\-3]
-.RE
+.EE
+.in
.SH FILES
/dev/ttyS[0\-3]
.SH SEE ALSO
.B ncpfs
is a network filesystem that supports the NCP protocol, used by
Novell NetWare.
-.sp
+.IP
To use
.BR ncpfs ,
you need special programs, which can be found at
.B smb
is a network filesystem that supports the SMB protocol, used by
Windows for Workgroups, Windows NT, and Lan Manager.
-.sp
+.IP
To use
.B smb
fs, you need a special mount program, which can be found in the ksmbfs
.I /etc/group
file is a text file that defines the groups on the system.
There is one entry per line, with the following format:
-.sp
-.RS
+.PP
+.in +4n
+.EX
group_name:password:GID:user_list
-.RE
-.sp
+.EE
+.in
+.PP
The fields are as follows:
.TP 12
.I group_name
.PP
Each line of the file describes a single user,
and contains seven colon-separated fields:
-.sp
-.RS
+.PP
+.in +4n
+.EX
name:password:UID:GID:GECOS:directory:shell
-.RE
-.sp
+.EE
+.in
+.PP
The field are as follows:
.TP 12
.I name
.SH EXAMPLE
.I /etc/shells
may contain the following paths:
-.sp
-.RS
+.PP
+.in +4n
+.EX
.I /bin/sh
-.br
.I /bin/bash
-.br
.I /bin/csh
-.RE
+.EE
+.in
.SH SEE ALSO
.BR chsh (1),
.BR getusershell (3)
alphabetically without looking at lower or upper spelling.
Capabilities of similar functions can be written in one line.
.LP
-.nf
Example for:
-.sp
+.nf
+.PP
Head line: vt|vt101|DEC VT 101 terminal in 80 character mode:\e
Head line: Vt|vt101-w|DEC VT 101 terminal in (wide) 132 character mode:\e
Boolean: :bs:\e
symbol and the second characters is its definition.
.LP
The following names are available:
-.sp
+.PP
.nf
+ right arrow (>)
, left arrow (<)
x vertical line (|)
~ paragraph (???)
.fi
-.sp
+.PP
The values in parentheses are suggested defaults which are used by the
.IR curses
library, if the capabilities are missing.
A typical
.I /etc/ttytype
is:
-.RS
-.sp
+.PP
+.in +4n
+.EX
con80x25 tty1
-.br
vt320 ttys0
-.RE
+.EE
+.in
.SH SEE ALSO
.BR termcap (5),
.BR terminfo (5),
.I tzh_typecnt
.I ttinfo
entries, each defined as follows:
-.in +.5i
-.sp
-.nf
-.ta .5i +\w'unsigned char\0\0'u
+.PP
+.in +4n
+.EX
struct ttinfo {
- int32_t tt_gmtoff;
- unsigned char tt_isdst;
- unsigned char tt_abbrind;
+ int32_t tt_gmtoff;
+ unsigned char tt_isdst;
+ unsigned char tt_abbrind;
};
-.in -.5i
-.fi
-.sp
+.EE
+.in
+.PP
Each structure is written as a four-byte signed integer value for
.IR tt_gmtoff ,
in a standard byte order, followed by a one-byte value for
.IR <utmp.h>
(note that this is only one of several definitions
around; details depend on the version of libc):
+.in
.in +4n
-.nf
-.sp
+.EX
/* Values for ut_type field, below */
#define EMPTY 0 /* Record does not contain valid info
#endif
#define ut_xtime ut_tv.tv_sec
#define ut_addr ut_addr_v6[0]
-.sp
-.fi
+.EE
.in
+.PP
This structure gives the name of the special file associated with the
user's terminal, the user's login name, and the time of login in the form
of
.IR tv_usec .
Since \fIut_tv\fP may not be the same as \fIstruct timeval\fP,
then instead of the call:
+.PP
.in +4n
-.nf
-.sp
+.EX
gettimeofday((struct timeval *) &ut.ut_tv, NULL);
-.fi
+.EE
.in
.PP
the following method of setting this field is recommended:
+.PP
.in +4n
-.nf
-.sp
+.EX
struct utmp ut;
struct timeval tv;
gettimeofday(&tv, NULL);
ut.ut_tv.tv_sec = tv.tv_sec;
ut.ut_tv.tv_usec = tv.tv_usec;
-.fi
+.EE
.in
.\" .PP
.\" Note that the \fIutmp\fP struct from libc5 has changed in libc6.
\}
.SS Tables
For convenience, below are more compact tables in hex and decimal.
-.sp
+.PP
.nf
.if t \{\
.in 1i
supply the kernel with information about hardware parameters that
the kernel would not be able to determine on its own, or to avoid/override
the values that the kernel would otherwise detect.
-
+.PP
When the kernel is booted directly by the BIOS,
you have no opportunity to specify any parameters.
So, in order to take advantage of this possibility you have to
The kernel command line is parsed into a list of strings
(boot arguments) separated by spaces.
Most of the boot arguments have the form:
-
+.PP
.in +4n
-.nf
+.EX
name[=value_1][,value_2]...[,value_10]
-.fi
+.EE
.in
.LP
where 'name' is a unique keyword that is used to identify what part of
(However, you can reuse the same
keyword with up to an additional 10 parameters in unusually
complicated situations, assuming the setup function supports it.)
-
+.PP
Most of the sorting is coded in the kernel source file
.IR init/main.c .
First, the kernel
checks to see if the argument is any of the special arguments 'root=',
\&'nfsroot=', 'nfsaddrs=', 'ro', 'rw', 'debug' or 'init'.
The meaning of these special arguments is described below.
-
+.PP
Then it walks a list of setup functions
to see if the specified argument string (such as 'foo') has
been associated with a setup function ('foo_setup()') for a particular
If it was, then it would call the setup
function associated with 'foo' (foo_setup()) and hand it the arguments
3, 4, 5, and 6 as given on the kernel command line.
-
+.PP
Anything of the form 'foo=bar' that is not accepted as a setup function
as described above is then interpreted as an environment variable to
be set.
A (useless?) example would be to use 'TERM=vt100' as a boot
argument.
-
+.PP
Any remaining arguments that were not picked up by the kernel and were
not interpreted as environment variables are then passed onto PID 1,
which is usually the
To override this value, and
select the second floppy drive as the root device, one would
use 'root=/dev/fd1'.
-
+.IP
The root device can be specified symbolically or numerically.
A symbolic specification has the form
.IR /dev/XXYN ,
\&'a'-'d'; 'sd' for SCSI compatible disk, with Y in 'a'-'e'),
Y the driver letter or
number, and N the number (in decimal) of the partition on this device.
-
+.IP
Note that this has nothing to do with the designation of these
devices on your filesystem.
The '/dev/' part is purely conventional.
-
+.IP
The more awkward and less portable numeric specification of the above
possible root devices in major/minor format is also accepted.
(For example,
as read/write capable, for example, by 'mount \-w \-n \-o remount /'.
(See also
.BR mount (8).)
-
+.IP
The 'rw' option tells the kernel to mount the root filesystem read/write.
This is the default.
.TP
This tells the kernel the location of the suspend-to-disk data that you want the machine to resume from after hibernation.
Usually, it is the same as your swap partition or file.
Example:
-
+.IP
.in +4n
-.nf
+.EX
resume=/dev/hda2
-.fi
+.EE
.in
.TP
.B "'reserve=...'"
This is used to protect I/O port regions from probes.
The form of the command is:
-
+.IP
.in +4n
-.nf
+.EX
.BI reserve= iobase,extent[,iobase,extent]...
-.fi
+.EE
.in
-.sp
+.IP
In some machines it may be necessary to prevent device drivers from
checking for devices (auto-probing) in a specific region.
This may be
because of hardware that reacts badly to the probing, or hardware
that would be mistakenly identified, or merely
hardware you don't want the kernel to initialize.
-
+.IP
The reserve boot-time argument specifies an I/O port region that
shouldn't be probed.
A device driver will not probe a reserved region,
unless another boot argument explicitly specifies that it do so.
-
+.IP
For example, the boot line
-
+.IP
.in +4n
-.nf
+.EX
reserve=0x300,32 blah=0x300
-.fi
+.EE
.in
.IP
keeps all device drivers except the driver for 'blah' from probing
By default, the kernel will not reboot after a panic, but this option
will cause a kernel reboot after N seconds (if N is greater than zero).
This panic timeout can also be set by
-
+.IP
.in +4n
-.nf
+.EX
echo N > /proc/sys/kernel/panic
-.fi
+.EE
.in
.TP
.B "'reboot=[warm|cold][,[bios|hard]]'"
The significance of this variable is that it
gives the granularity of the profiling: each clock tick, if the
system was executing kernel code, a counter is incremented:
-
+.IP
.in +4n
-.nf
+.EX
profile[address >> prof_shift]++;
-.fi
+.EE
.in
-.sp
+.IP
The raw profiling information can be read from
.IR /proc/profile .
Probably you'll want to use a tool such as readprofile.c to digest it.
One might also have a system in which first
some modules (for filesystem or hardware) must be loaded
before the main disk can be accessed.
-
+.IP
In Linux 1.3.48, ramdisk handling was changed drastically.
Earlier, the memory was allocated statically, and there was
a 'ramdisk=N' parameter to tell its size.
.IR Documentation/blockdev/ramdisk.txt
.RI ( Documentation/ramdisk.txt
in older kernels).
-
+.IP
There are four parameters, two boolean and two integral.
.TP
.B "'load_ramdisk=N'"
the usual boot sequence (e.g., invocation of
.IR /sbin/init )
is performed.
-
+.IP
For a detailed description of the initrd feature, see the kernel source file
.IR Documentation/initrd.txt .
-
+.IP
The 'noinitrd' option tells the kernel that although it was compiled for
operation with initrd, it should not go through the above steps, but
leave the initrd data under
.IR /dev/initrd .)
.SS Boot arguments for SCSI devices
General notation for this section:
-
+.PP
.I iobase
-- the first I/O port that the SCSI host occupies.
These are specified in hexadecimal notation,
and usually lie in the range from 0x200 to 0x3ff.
-
+.PP
.I irq
-- the hardware interrupt that the card is configured to use.
Valid values will be dependent on the card in question, but will
The other values are usually
used for common peripherals like IDE hard disks, floppies, serial
ports, and so on.
-
+.PP
.I scsi-id
-- the ID that the host adapter uses to identify itself on the
SCSI bus.
most have it permanently specified internally.
The usual default value
is 7, but the Seagate and Future Domain TMC-950 boards use 6.
-
+.PP
.I parity
-- whether the SCSI host adapter expects the attached devices
to supply a parity value with all information exchanges.
But most
devices, such as hard disks, tape drives and such are only one device,
and will be assigned to LUN zero.
-
+.IP
Some poorly designed SCSI devices cannot handle being probed for
LUNs not equal to zero.
Therefore, if the compile-time flag
.B CONFIG_SCSI_MULTI_LUN
is not set, newer kernels will by default probe only LUN zero.
-
+.IP
To specify the number of probed LUNs at boot, one enters
\&'max_scsi_luns=n' as a boot arg, where n is a number between one and
eight.
.B "SCSI tape configuration"
Some boot time configuration of the SCSI tape driver can be achieved
by using the following:
-
+.IP
.in +4n
-.nf
+.EX
.BI st= buf_size[,write_threshold[,max_bufs]]
-.fi
+.EE
.in
-.sp
+.IP
The first two numbers are specified in units of kB.
The default
.I buf_size
The maximum number of buffers varies
with the number of drives detected, and has a default of two.
An example usage would be:
-
+.IP
.in +4n
-.nf
+.EX
st=32,30,2
-.fi
+.EE
.in
.IP
Full details can be found in the file
The IDE driver accepts a number of parameters, which range from disk
geometry specifications, to support for broken controller chips.
Drive-specific options are specified by using 'hdX=' with X in 'a'-'h'.
-
+.IP
Non-drive-specific options are specified with the prefix 'hd='.
Note that using a drive-specific prefix for a non-drive-specific option
will still work, and the option will just be applied as expected.
-
+.IP
Also note that 'hd=' can be used to refer to the next unspecified
drive in the (a, ..., h) sequence.
For the following discussions,
.B "The 'hd=noprobe' option"
Do not probe for this drive.
For example,
-
+.IP
.in +4n
-.nf
+.EX
hdb=noprobe hdb=1166,7,17
-.fi
+.EE
.in
.IP
would disable the probe, but still specify the drive geometry so
Also, it accepts only 'hd=' as an argument, that is, 'hda='
and so on are not valid here.
The format is as follows:
-
+.IP
.in +4n
-.nf
+.EX
hd=cyls,heads,sects
-.fi
+.EE
.in
.IP
If there are two disks installed, the above is repeated with the
Different drivers make use of different parameters, but they all at
least share having an IRQ, an I/O port base value, and a name.
In its most generic form, it looks something like this:
-
+.PP
.in +4n
-.nf
+.EX
ether=irq,iobase[,param_1[,...param_8]],name
-.fi
+.EE
.in
-
+.PP
The first nonnumeric argument is taken as the name.
The param_n values (if applicable) usually have different meanings for each
different card/driver.
Typical param_n values are used to specify
things like shared memory address, interface selection, DMA channel
and the like.
-
+.PP
The most common use of this parameter is to force probing for a second
ethercard, as the default is to probe only for one.
This can be accomplished with a simple:
-
+.PP
.in +4n
-.nf
+.EX
ether=0,0,eth1
-.fi
+.EE
.in
-
+.PP
Note that the values of zero for the IRQ and I/O base in the above
example tell the driver(s) to autoprobe.
-
+.PP
The Ethernet-HowTo has extensive documentation on using multiple
cards and on the card/driver-specific implementation
of the param_n values where used.
in older kernel versions).
It accepts
a boot argument of the form:
-
+.PP
.in +4n
-.nf
+.EX
sound=device1[,device2[,device3...[,device10]]]
-.fi
+.EE
.in
-.IP
+.PP
where each deviceN value is of the following format 0xTaaaId and the
bytes are used as follows:
-
+.PP
T \- device type: 1=FM, 2=SB, 3=PAS, 4=GUS, 5=MPU401, 6=SB16,
7=SB16-MPU401
-
+.PP
aaa \- I/O address in hex.
-
+.PP
I \- interrupt line in hex (i.e., 10=a, 11=b, ...)
-
+.PP
d \- DMA channel.
-
+.PP
As you can see, it gets pretty messy, and you are better off to compile
in your own personal values as recommended.
Using a boot argument of
.B "'lp='"
.br
Syntax:
-
+.IP
.in +4n
-.nf
+.EX
lp=0
lp=auto
lp=reset
lp=port[,port...]
-.fi
+.EE
.in
.IP
You can tell the printer driver what ports to use and what ports not
The latter comes in handy if you don't want the printer driver
to claim all available parallel ports, so that other drivers
(e.g., PLIP, PPA) can use them instead.
-
+.IP
The format of the argument is multiple port names.
For example,
lp=none,parport0 would use the first parallel port for lp1, and
.SH SEE ALSO
.BR klogd (8),
.BR mount (8)
-
+.PP
For up-to-date information, see the kernel source file
.IR Documentation/admin-guide/kernel-parameters.txt .
Your C-compiler can work with complex numbers if it supports the C99 standard.
Link with \fI\-lm\fP.
The imaginary unit is represented by I.
-.sp
-.nf
+.PP
+.EX
/* check that exp(i * pi) == \-1 */
#include <math.h> /* for atan */
#include <stdio.h>
double complex z = cexp(I * pi);
printf("%f + %f * i\\n", creal(z), cimag(z));
}
-.fi
+.EE
.SH SEE ALSO
.BR cabs (3),
.BR cacos (3),
in the two formats \fBMask Format\fR and \fBList Format\fR (see below)
as shown in the following example:
.PP
-.RS
-.nf
+.in +4n
+.EX
Cpus_allowed: ffffffff,ffffffff,ffffffff,ffffffff
Cpus_allowed_list: 0-127
Mems_allowed: ffffffff,ffffffff
Mems_allowed_list: 0-63
-.fi
+.EE
.RE
.PP
The "allowed" fields were added in Linux 2.6.24;
The usual contents of the command
.I /sbin/cpuset_release_agent
is simply the shell script:
+.PP
.in +4n
-.nf
-
+.EX
#!/bin/sh
rmdir /dev/cpuset/$1
-.fi
+.EE
.in
.PP
As with other flag values below, this flag can
2.6.26, on certain popular architectures, the positive values of
.I sched_relax_domain_level
have the following meanings.
-.sp
+.PP
.PD 0
.IP \fB(1)\fR 4
Perform immediate load balancing across Hyper-Thread
.PP
Examples of the \fBMask Format\fR:
.PP
-.RS
-.nf
+.in +4n
+.EX
00000001 # just bit 0 set
40000000,00000000,00000000 # just bit 94 set
00000001,00000000,00000000 # just bit 64 set
000000ff,00000000 # bits 32-39 set
00000000,000e3862 # 1,5,6,11-13,17-19 set
-.fi
-.RE
+.EE
+.in
.PP
A mask with bits 0, 1, 2, 4, 8, 16, 32, and 64 set displays as:
.PP
-.RS
-.nf
+.in +4n
+.EX
00000001,00000001,00010117
-.fi
-.RE
+.EE
+.in
.PP
The first "1" is for bit 64, the
second for bit 32, the third for bit 16, the fourth for bit 8, the
.PP
Examples of the \fBList Format\fR:
.PP
-.RS
-.nf
+.in +4n
+.EX
0-4,9 # bits 0, 1, 2, 3, 4, and 9 set
0-2,7,12-14 # bits 0, 1, 2, 7, 12, 13, and 14 set
-.fi
-.RE
+.EE
+.in
.\" ================== RULES ==================
.SH RULES
The following rules apply to each cpuset:
system call fails.
.\" Gack! csh(1)'s echo does this
For example, if the command:
+.PP
.in +4n
-.nf
-
+.EX
echo 19 > cpuset.mems
-
-.fi
+.EE
.in
+.PP
failed because memory node 19 was not allowed (perhaps
the current system does not have a memory node 19), then the
.B echo
command will display
.BR write (2)
errors, as in the example:
+.PP
.in +4n
-.nf
-
+.EX
/bin/echo 19 > cpuset.mems
/bin/echo: write error: Invalid argument
-.fi
+.EE
.in
.\" ================== EXCEPTIONS ==================
.SH EXCEPTIONS
.SS Creating and attaching to a cpuset.
To create a new cpuset and attach the current command shell to it,
the steps are:
-.sp
+.PP
.PD 0
.IP 1) 4
mkdir /dev/cpuset (if not already done)
For example, the following sequence of commands will set up a cpuset
named "Charlie", containing just CPUs 2 and 3, and memory node 1,
and then attach the current shell to that cpuset.
+.PP
.in +4n
-.nf
-
+.EX
.RB "$" " mkdir /dev/cpuset"
.RB "$" " mount \-t cpuset cpuset /dev/cpuset"
.RB "$" " cd /dev/cpuset"
# The current shell is now running in cpuset Charlie
# The next line should display '/Charlie'
.RB "$" " cat /proc/self/cpuset"
-.fi
+.EE
.in
+.\"
.SS Migrating a job to different memory nodes.
To migrate a job (the set of processes attached to a cpuset)
to different CPUs and memory nodes in the system, including moving
the memory pages currently allocated to that job,
perform the following steps.
-.sp
+.PP
.PD 0
.IP 1) 4
Let's say we want to move the job in cpuset
.PD
.PP
The following sequence of commands accomplishes this.
+.PP
.in +4n
-.nf
-
+.EX
.RB "$" " cd /dev/cpuset"
.RB "$" " mkdir beta"
.RB "$" " cd beta"
.RB "$" " /bin/echo 8-9 > cpuset.mems"
.RB "$" " /bin/echo 1 > cpuset.memory_migrate"
.RB "$" " while read i; do /bin/echo $i; done < ../alpha/tasks > tasks"
-.fi
+.EE
.in
.PP
The above should move any processes in
nodes 8-9, respectively.
.PP
Notice that the last step of the above sequence did not do:
+.PP
.in +4n
-.nf
-
+.EX
.RB "$" " cp ../alpha/tasks tasks"
-.fi
+.EE
.in
.PP
The
.B \-u
(unbuffered) option of
.BR sed (1):
+.PP
.in +4n
-
-.nf
+.EX
.RB "$" " sed \-un p < ../alpha/tasks > tasks"
-.fi
+.EE
.in
.\" ================== SEE ALSO ==================
.SH SEE ALSO
from where it stopped before.
.PP
.in +4n
-.nf
+.EX
#define MAX_EVENTS 10
struct epoll_event ev, events[MAX_EVENTS];
int listen_sock, conn_sock, nfds, epollfd;
}
}
}
-.fi
+.EE
.in
.PP
When used as an edge-triggered interface, for performance reasons, it is
read/write yields
.BR EAGAIN .
When and how you will use the file descriptor is entirely up to you.
-.sp
+.IP
For packet/token-oriented files (e.g., datagram socket,
terminal in canonical mode),
the only way to detect the end of the read/write I/O space
is to continue to read/write until
.BR EAGAIN .
-.sp
+.IP
For stream-oriented files (e.g., pipe, FIFO, stream socket), the
condition that the read/write I/O space is exhausted can also be detected by
checking the amount of data read from / written to the target file