$ \fBmkdir -p $HOME/.locale\fP
$ \fBI18NPATH=./wrk/ localedef -f UTF-8 -i fi_SE $HOME/.locale/fi_SE.UTF-8\fP
$ \fBLOCPATH=$HOME/.locale LC_ALL=fi_SE.UTF-8 date\fP
-$ \fBecho "export LOCPATH=\\$HOME/.locale" >> $HOME/.bashrc\fP
+$ \fBecho "export LOCPATH=\e$HOME/.locale" >> $HOME/.bashrc\fP
$ \fBecho "export LANG=fi_SE.UTF-8" >> $HOME/.bashrc\fP
.EE
.SH SEE ALSO
int i, j;
int *p;
- printf("malloc: %zd\\n", sizeof(int) * 100);
+ printf("malloc: %zd\en", sizeof(int) * 100);
p = malloc(sizeof(int) * 100);
for (i = 0; i < CYCLES; i++) {
else
j--;
- printf("realloc: %zd\\n", sizeof(int) * (j * 50 + 110));
+ printf("realloc: %zd\en", sizeof(int) * (j * 50 + 110));
p = realloc(p, sizeof(int) * (j * 50 + 100));
- printf("realloc: %zd\\n", sizeof(int) * ((j+1) * 150 + 110));
+ printf("realloc: %zd\en", sizeof(int) * ((j+1) * 150 + 110));
p = realloc(p, sizeof(int) * ((j + 1) * 150 + 110));
}
.PP
.in +4n
.EX
-$ \fBgdb \-ex "set confirm off" \-ex "set height 0" \-ex "info shared" \\\fP
+$ \fBgdb \-ex "set confirm off" \-ex "set height 0" \-ex "info shared" \e\fP
\fB-ex "quit" \-p $pid | grep '^0x.*0x'\fP
.EE
.in
int error;
error = sysinfo(&s_info);
- printf("code error = %d\\n", error);
- printf("Uptime = %lds\\nLoad: 1 min %lu / 5 min %lu / 15 min %lu\\n"
- "RAM: total %lu / free %lu / shared %lu\\n"
- "Memory in buffers = %lu\\nSwap: total %lu / free %lu\\n"
- "Number of processes = %d\\n",
+ printf("code error = %d\en", error);
+ printf("Uptime = %lds\enLoad: 1 min %lu / 5 min %lu / 15 min %lu\en"
+ "RAM: total %lu / free %lu / shared %lu\en"
+ "Memory in buffers = %lu\enSwap: total %lu / free %lu\en"
+ "Number of processes = %d\en",
s_info.uptime, s_info.loads[0],
s_info.loads[1], s_info.loads[2],
s_info.totalram, s_info.freeram,
key_serial_t key;
if (argc != 4) {
- fprintf(stderr, "Usage: %s type description payload\\n",
+ fprintf(stderr, "Usage: %s type description payload\en",
argv[0]);
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}
- printf("Key ID is %lx\\n", (long) key);
+ printf("Key ID is %lx\en", (long) key);
exit(EXIT_SUCCESS);
}
#define MY_SOCK_PATH "/somepath"
#define LISTEN_BACKLOG 50
-#define handle_error(msg) \\
+#define handle_error(msg) \e
do { perror(msg); exit(EXIT_FAILURE); } while (0)
int
map_fd = bpf_create_map(BPF_MAP_TYPE_ARRAY, sizeof(key),
sizeof(value), 256);
if (map_fd < 0) {
- printf("failed to create map '%s'\\n", strerror(errno));
+ printf("failed to create map '%s'\en", strerror(errno));
/* likely not run as root */
return 1;
}
assert(bpf_lookup_elem(map_fd, &key, &tcp_cnt) == 0);
key = IPPROTO_UDP;
assert(bpf_lookup_elem(map_fd, &key, &udp_cnt) == 0);
- printf("TCP %lld UDP %lld packets\\n", tcp_cnt, udp_cnt);
+ printf("TCP %lld UDP %lld packets\en", tcp_cnt, udp_cnt);
sleep(1);
}
struct passwd *pwd;
char *endptr;
- if (argc != 3 || argv[1][0] == \(aq\\0\(aq) {
- fprintf(stderr, "%s <owner> <file>\\n", argv[0]);
+ if (argc != 3 || argv[1][0] == \(aq\e0\(aq) {
+ fprintf(stderr, "%s <owner> <file>\en", argv[0]);
exit(EXIT_FAILURE);
}
uid = strtol(argv[1], &endptr, 10); /* Allow a numeric string */
- if (*endptr != \(aq\\0\(aq) { /* Was not pure numeric string */
+ if (*endptr != \(aq\e0\(aq) { /* Was not pure numeric string */
pwd = getpwnam(argv[1]); /* Try getting UID for username */
if (pwd == NULL) {
perror("getpwnam");
#include <stdlib.h>
#include <unistd.h>
-#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\
+#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e
} while (0)
static int /* Start function for cloned child */
if (uname(&uts) == \-1)
errExit("uname");
- printf("uts.nodename in child: %s\\n", uts.nodename);
+ printf("uts.nodename in child: %s\en", uts.nodename);
/* Keep the namespace open for a while, by sleeping.
This allows some experimentation\-\-for example, another
struct utsname uts;
if (argc < 2) {
- fprintf(stderr, "Usage: %s <child\-hostname>\\n", argv[0]);
+ fprintf(stderr, "Usage: %s <child\-hostname>\en", argv[0]);
exit(EXIT_SUCCESS);
}
pid = clone(childFunc, stackTop, CLONE_NEWUTS | SIGCHLD, argv[1]);
if (pid == \-1)
errExit("clone");
- printf("clone() returned %ld\\n", (long) pid);
+ printf("clone() returned %ld\en", (long) pid);
/* Parent falls through to here */
if (uname(&uts) == \-1)
errExit("uname");
- printf("uts.nodename in parent: %s\\n", uts.nodename);
+ printf("uts.nodename in parent: %s\en", uts.nodename);
if (waitpid(pid, NULL, 0) == \-1) /* Wait for child */
errExit("waitpid");
- printf("child has terminated\\n");
+ printf("child has terminated\en");
exit(EXIT_SUCCESS);
}
loff_t len, ret;
if (argc != 3) {
- fprintf(stderr, "Usage: %s <source> <destination>\\n", argv[0]);
+ fprintf(stderr, "Usage: %s <source> <destination>\en", argv[0]);
exit(EXIT_FAILURE);
}
#include <stdio.h>
#include <stdint.h> /* Definition of uint64_t */
-#define handle_error(msg) \\
+#define handle_error(msg) \e
do { perror(msg); exit(EXIT_FAILURE); } while (0)
int
ssize_t s;
if (argc < 2) {
- fprintf(stderr, "Usage: %s <num>...\\n", argv[0]);
+ fprintf(stderr, "Usage: %s <num>...\en", argv[0]);
exit(EXIT_FAILURE);
}
switch (fork()) {
case 0:
for (j = 1; j < argc; j++) {
- printf("Child writing %s to efd\\n", argv[j]);
+ printf("Child writing %s to efd\en", argv[j]);
u = strtoull(argv[j], NULL, 0);
/* strtoull() allows various bases */
s = write(efd, &u, sizeof(uint64_t));
if (s != sizeof(uint64_t))
handle_error("write");
}
- printf("Child completed write loop\\n");
+ printf("Child completed write loop\en");
exit(EXIT_SUCCESS);
default:
sleep(2);
- printf("Parent about to read\\n");
+ printf("Parent about to read\en");
s = read(efd, &u, sizeof(uint64_t));
if (s != sizeof(uint64_t))
handle_error("read");
- printf("Parent read %llu (0x%llx) from efd\\n",
+ printf("Parent read %llu (0x%llx) from efd\en",
(unsigned long long) u, (unsigned long long) u);
exit(EXIT_SUCCESS);
int j;
for (j = 0; j < argc; j++)
- printf("argv[%d]: %s\\n", j, argv[j]);
+ printf("argv[%d]: %s\en", j, argv[j]);
exit(EXIT_SUCCESS);
}
char *newenviron[] = { NULL };
if (argc != 2) {
- fprintf(stderr, "Usage: %s <file\-to\-exec>\\n", argv[0]);
+ fprintf(stderr, "Usage: %s <file\-to\-exec>\en", argv[0]);
exit(EXIT_FAILURE);
}
.IP
.in +4n
.EX
-#define FUTEX_OP(op, oparg, cmp, cmparg) \\
- (((op & 0xf) << 28) | \\
- ((cmp & 0xf) << 24) | \\
- ((oparg & 0xfff) << 12) | \\
+#define FUTEX_OP(op, oparg, cmp, cmparg) \e
+ (((op & 0xf) << 28) | \e
+ ((cmp & 0xf) << 24) | \e
+ ((oparg & 0xfff) << 12) | \e
(cmparg & 0xfff))
.EE
.in
#include <linux/futex.h>
#include <sys/time.h>
-#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\
+#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e
} while (0)
static int *futex1, *futex2, *iaddr;
if (childPid == 0) { /* Child */
for (j = 0; j < nloops; j++) {
fwait(futex1);
- printf("Child (%ld) %d\\n", (long) getpid(), j);
+ printf("Child (%ld) %d\en", (long) getpid(), j);
fpost(futex2);
}
for (j = 0; j < nloops; j++) {
fwait(futex2);
- printf("Parent (%ld) %d\\n", (long) getpid(), j);
+ printf("Parent (%ld) %d\en", (long) getpid(), j);
fpost(futex1);
}
#include <sys/stat.h>
#include <sys/syscall.h>
-#define handle_error(msg) \\
+#define handle_error(msg) \e
do { perror(msg); exit(EXIT_FAILURE); } while (0)
struct linux_dirent {
if (nread == 0)
break;
- printf("\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- nread=%d \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\\n", nread);
- printf("inode# file type d_reclen d_off d_name\\n");
+ printf("\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- nread=%d \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\en", nread);
+ printf("inode# file type d_reclen d_off d_name\en");
for (bpos = 0; bpos < nread;) {
d = (struct linux_dirent *) (buf + bpos);
printf("%8ld ", d\->d_ino);
(d_type == DT_LNK) ? "symlink" :
(d_type == DT_BLK) ? "block dev" :
(d_type == DT_CHR) ? "char dev" : "???");
- printf("%4d %10lld %s\\n", d\->d_reclen,
+ printf("%4d %10lld %s\en", d\->d_reclen,
(long long) d\->d_off, d\->d_name);
bpos += d\->d_reclen;
}
#include <unistd.h>
#include <sys/resource.h>
-#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\
+#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e
} while (0)
int
if (!(argc == 2 || argc == 4)) {
fprintf(stderr, "Usage: %s <pid> [<new\-soft\-limit> "
- "<new\-hard\-limit>]\\n", argv[0]);
+ "<new\-hard\-limit>]\en", argv[0]);
exit(EXIT_FAILURE);
}
if (prlimit(pid, RLIMIT_CPU, newp, &old) == \-1)
errExit("prlimit\-1");
- printf("Previous limits: soft=%lld; hard=%lld\\n",
+ printf("Previous limits: soft=%lld; hard=%lld\en",
(long long) old.rlim_cur, (long long) old.rlim_max);
/* Retrieve and display new CPU time limit */
if (prlimit(pid, RLIMIT_CPU, NULL, &old) == \-1)
errExit("prlimit\-2");
- printf("New limits: soft=%lld; hard=%lld\\n",
+ printf("New limits: soft=%lld; hard=%lld\en",
(long long) old.rlim_cur, (long long) old.rlim_max);
exit(EXIT_SUCCESS);
.PP
.in +4n
.EX
-printf("Volume ID %04x-%04x\\n", id >> 16, id & 0xFFFF);
+printf("Volume ID %04x-%04x\en", id >> 16, id & 0xFFFF);
.EE
.in
.SS Reading short file names of a directory
}
if (attr & ATTR_ARCH)
- printf("Archive flag is set\\n");
+ printf("Archive flag is set\en");
else
- printf("Archive flag is not set\\n");
+ printf("Archive flag is not set\en");
return attr;
}
int ret;
if (argc != 2) {
- printf("Usage: %s FILENAME\\n", argv[0]);
+ printf("Usage: %s FILENAME\en", argv[0]);
exit(EXIT_FAILURE);
}
/*
* Invert archive attribute.
*/
- printf("Toggling archive flag\\n");
+ printf("Toggling archive flag\en");
attr ^= ATTR_ARCH;
/*
int ret;
if (argc != 2) {
- printf("Usage: %s FILENAME\\n", argv[0]);
+ printf("Usage: %s FILENAME\en", argv[0]);
exit(EXIT_FAILURE);
}
/*
* Format the output as two groups of 16 bits each.
*/
- printf("Volume ID %04x\-%04x\\n", id >> 16, id & 0xFFFF);
+ printf("Volume ID %04x\-%04x\en", id >> 16, id & 0xFFFF);
close(fd);
int ret;
if (argc != 2) {
- printf("Usage: %s DIRECTORY\\n", argv[0]);
+ printf("Usage: %s DIRECTORY\en", argv[0]);
exit(EXIT_FAILURE);
}
/*
* Write both the short name and the long name.
*/
- printf("%s \-> '%s'\\n", entry[0].d_name, entry[1].d_name);
+ printf("%s \-> '%s'\en", entry[0].d_name, entry[1].d_name);
}
if (ret == \-1) {
struct stat sb;
if (argc < 2) {
- fprintf(stderr, "Usage: %s /proc/[pid]/ns/[file] [p|u]\\n",
+ fprintf(stderr, "Usage: %s /proc/[pid]/ns/[file] [p|u]\en",
argv[0]);
- fprintf(stderr, "\\nDisplay the result of one or both "
- "of NS_GET_USERNS (u) or NS_GET_PARENT (p)\\n"
+ fprintf(stderr, "\enDisplay the result of one or both "
+ "of NS_GET_USERNS (u) or NS_GET_PARENT (p)\en"
"for the specified /proc/[pid]/ns/[file]. If neither "
- "\(aqp\(aq nor \(aqu\(aq is specified,\\n"
- "NS_GET_USERNS is the default.\\n");
+ "\(aqp\(aq nor \(aqu\(aq is specified,\en"
+ "NS_GET_USERNS is the default.\en");
exit(EXIT_FAILURE);
}
if (userns_fd == \-1) {
if (errno == EPERM)
printf("The owning user namespace is outside "
- "your namespace scope\\n");
+ "your namespace scope\en");
else
perror("ioctl\-NS_GET_USERNS");
exit(EXIT_FAILURE);
exit(EXIT_FAILURE);
}
printf("Device/Inode of owning user namespace is: "
- "[%lx,%lx] / %ld\\n",
+ "[%lx,%lx] / %ld\en",
(long) major(sb.st_dev), (long) minor(sb.st_dev),
(long) sb.st_ino);
if (parent_fd == \-1) {
if (errno == EINVAL)
printf("Can\(aq get parent namespace of a "
- "nonhierarchical namespace\\n");
+ "nonhierarchical namespace\en");
else if (errno == EPERM)
printf("The parent namespace is outside "
- "your namespace scope\\n");
+ "your namespace scope\en");
else
perror("ioctl\-NS_GET_PARENT");
exit(EXIT_FAILURE);
perror("fstat\-parentns");
exit(EXIT_FAILURE);
}
- printf("Device/Inode of parent namespace is: [%lx,%lx] / %ld\\n",
+ printf("Device/Inode of parent namespace is: [%lx,%lx] / %ld\en",
(long) major(sb.st_dev), (long) minor(sb.st_dev),
(long) sb.st_ino);
#include <fcntl.h>
#include <linux/kcmp.h>
-#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\
+#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e
} while (0)
static int
static void
test_kcmp(char *msg, id_t pid1, pid_t pid2, int fd_a, int fd_b)
{
- printf("\\t%s\\n", msg);
- printf("\\t\\tkcmp(%ld, %ld, KCMP_FILE, %d, %d) ==> %s\\n",
+ printf("\et%s\en", msg);
+ printf("\et\etkcmp(%ld, %ld, KCMP_FILE, %d, %d) ==> %s\en",
(long) pid1, (long) pid2, fd_a, fd_b,
(kcmp(pid1, pid2, KCMP_FILE, fd_a, fd_b) == 0) ?
"same" : "different");
if (fd1 == \-1)
errExit("open");
- printf("Parent PID is %ld\\n", (long) getpid());
- printf("Parent opened file on FD %d\\n\\n", fd1);
+ printf("Parent PID is %ld\en", (long) getpid());
+ printf("Parent opened file on FD %d\en\en", fd1);
switch (fork()) {
case \-1:
errExit("fork");
case 0:
- printf("PID of child of fork() is %ld\\n", (long) getpid());
+ printf("PID of child of fork() is %ld\en", (long) getpid());
test_kcmp("Compare duplicate FDs from different processes:",
getpid(), getppid(), fd1, fd1);
fd2 = open(pathname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
if (fd2 == \-1)
errExit("open");
- printf("Child opened file on FD %d\\n", fd2);
+ printf("Child opened file on FD %d\en", fd2);
test_kcmp("Compare FDs from distinct open()s in same process:",
getpid(), getpid(), fd1, fd2);
fd3 = dup(fd1);
if (fd3 == \-1)
errExit("dup");
- printf("Child duplicated FD %d to create FD %d\\n", fd1, fd3);
+ printf("Child duplicated FD %d to create FD %d\en", fd1, fd3);
test_kcmp("Compare duplicated FDs in same process:",
getpid(), getpid(), fd1, fd3);
The
.IR cmdline_len
argument specifies size of the buffer.
-The last byte in the buffer must be a null byte (\(aq\\0\(aq).
+The last byte in the buffer must be a null byte (\(aq\e0\(aq).
.PP
The
.IR flags
.B EINVAL
The value in
.I cmdline[cmdline_len-1]
-is not \(aq\\0\(aq.
+is not \(aq\e0\(aq.
.TP
.B EINVAL
The file referred to by
setbuf(fp, NULL);
t = time(NULL);
- fprintf(fp, "Time: %s\\n", ctime(&t));
+ fprintf(fp, "Time: %s\en", ctime(&t));
/*
* The kernel passes a fixed set of arguments to the program
process_keyring = atoi(argv[6]);
session_keyring = atoi(argv[7]);
- fprintf(fp, "Command line arguments:\\n");
- fprintf(fp, " argv[0]: %s\\n", argv[0]);
- fprintf(fp, " operation: %s\\n", operation);
- fprintf(fp, " key_to_instantiate: %lx\\n",
+ fprintf(fp, "Command line arguments:\en");
+ fprintf(fp, " argv[0]: %s\en", argv[0]);
+ fprintf(fp, " operation: %s\en", operation);
+ fprintf(fp, " key_to_instantiate: %lx\en",
(long) key_to_instantiate);
- fprintf(fp, " UID: %ld\\n", (long) uid);
- fprintf(fp, " GID: %ld\\n", (long) gid);
- fprintf(fp, " thread_keyring: %lx\\n", (long) thread_keyring);
- fprintf(fp, " process_keyring: %lx\\n", (long) process_keyring);
- fprintf(fp, " session_keyring: %lx\\n", (long) session_keyring);
- fprintf(fp, "\\n");
+ fprintf(fp, " UID: %ld\en", (long) uid);
+ fprintf(fp, " GID: %ld\en", (long) gid);
+ fprintf(fp, " thread_keyring: %lx\en", (long) thread_keyring);
+ fprintf(fp, " process_keyring: %lx\en", (long) process_keyring);
+ fprintf(fp, " session_keyring: %lx\en", (long) session_keyring);
+ fprintf(fp, "\en");
/*
* Assume the authority to instantiate the key named in argv[2]
*/
if (keyctl(KEYCTL_ASSUME_AUTHORITY, key_to_instantiate) == \-1) {
- fprintf(fp, "KEYCTL_ASSUME_AUTHORITY failed: %s\\n",
+ fprintf(fp, "KEYCTL_ASSUME_AUTHORITY failed: %s\en",
strerror(errno));
exit(EXIT_FAILURE);
}
*/
if (keyctl(KEYCTL_DESCRIBE, key_to_instantiate,
dbuf, sizeof(dbuf)) == \-1) {
- fprintf(fp, "KEYCTL_DESCRIBE failed: %s\\n", strerror(errno));
+ fprintf(fp, "KEYCTL_DESCRIBE failed: %s\en", strerror(errno));
exit(EXIT_FAILURE);
}
- fprintf(fp, "Key description: %s\\n", dbuf);
+ fprintf(fp, "Key description: %s\en", dbuf);
/*
* Fetch the payload of the authorization key, which is
akp_size = keyctl(KEYCTL_READ, KEY_SPEC_REQKEY_AUTH_KEY,
auth_key_payload, sizeof(auth_key_payload));
if (akp_size == \-1) {
- fprintf(fp, "KEYCTL_READ failed: %s\\n", strerror(errno));
+ fprintf(fp, "KEYCTL_READ failed: %s\en", strerror(errno));
exit(EXIT_FAILURE);
}
- auth_key_payload[akp_size] = \(aq\\0\(aq;
- fprintf(fp, "Auth key payload: %s\\n", auth_key_payload);
+ auth_key_payload[akp_size] = \(aq\e0\(aq;
+ fprintf(fp, "Auth key payload: %s\en", auth_key_payload);
/*
* For interest, get the ID of the authorization key and
auth_key = keyctl(KEYCTL_GET_KEYRING_ID,
KEY_SPEC_REQKEY_AUTH_KEY);
if (auth_key == \-1) {
- fprintf(fp, "KEYCTL_GET_KEYRING_ID failed: %s\\n",
+ fprintf(fp, "KEYCTL_GET_KEYRING_ID failed: %s\en",
strerror(errno));
exit(EXIT_FAILURE);
}
- fprintf(fp, "Auth key ID: %lx\\n", (long) auth_key);
+ fprintf(fp, "Auth key ID: %lx\en", (long) auth_key);
/*
* Fetch key ID for the request_key(2) destination keyring.
dest_keyring = keyctl(KEYCTL_GET_KEYRING_ID,
KEY_SPEC_REQUESTOR_KEYRING);
if (dest_keyring == \-1) {
- fprintf(fp, "KEYCTL_GET_KEYRING_ID failed: %s\\n",
+ fprintf(fp, "KEYCTL_GET_KEYRING_ID failed: %s\en",
strerror(errno));
exit(EXIT_FAILURE);
}
- fprintf(fp, "Destination keyring: %lx\\n", (long) dest_keyring);
+ fprintf(fp, "Destination keyring: %lx\en", (long) dest_keyring);
/*
* Fetch the description of the authorization key. This
*/
if (keyctl(KEYCTL_DESCRIBE, KEY_SPEC_REQKEY_AUTH_KEY,
dbuf, sizeof(dbuf)) == \-1) {
- fprintf(fp, "KEYCTL_DESCRIBE failed: %s\\n", strerror(errno));
+ fprintf(fp, "KEYCTL_DESCRIBE failed: %s\en", strerror(errno));
exit(EXIT_FAILURE);
}
- fprintf(fp, "Auth key description: %s\\n", dbuf);
+ fprintf(fp, "Auth key description: %s\en", dbuf);
/*
* Instantiate the key using the callout data that was supplied
*/
if (keyctl(KEYCTL_INSTANTIATE, key_to_instantiate,
auth_key_payload, akp_size + 1, dest_keyring) == \-1) {
- fprintf(fp, "KEYCTL_INSTANTIATE failed: %s\\n",
+ fprintf(fp, "KEYCTL_INSTANTIATE failed: %s\en",
strerror(errno));
exit(EXIT_FAILURE);
}
The
.I list
of names is returned as an unordered array of null-terminated character
-strings (attribute names are separated by null bytes (\(aq\\0\(aq)), like this:
+strings (attribute names are separated by null bytes (\(aq\e0\(aq)), like this:
.PP
.in +4n
.EX
-user.name1\\0system.name1\\0user.name2\\0
+user.name1\e0system.name1\e0user.name2\e0
.EE
.in
.PP
.PP
.in +4n
.EX
-system.posix_acl_access\\0system.posix_acl_default\\0
+system.posix_acl_access\e0system.posix_acl_default\e0
.EE
.in
.SH RETURN VALUE
char *buf, *key, *val;
if (argc != 2) {
- fprintf(stderr, "Usage: %s path\\n", argv[0]);
+ fprintf(stderr, "Usage: %s path\en", argv[0]);
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}
if (buflen == 0) {
- printf("%s has no attributes.\\n", argv[1]);
+ printf("%s has no attributes.\en", argv[1]);
exit(EXIT_SUCCESS);
}
} else if (vallen == 0)
printf("<no value>");
- printf("\\n");
+ printf("\en");
/*
* Forward to next attribute key.
allows the file offset to be set beyond the end
of the file (but this does not change the size of the file).
If data is later written at this point, subsequent reads of the data
-in the gap (a "hole") return null bytes (\(aq\\0\(aq) until
+in the gap (a "hole") return null bytes (\(aq\e0\(aq) until
data is actually written into the gap.
.SS Seeking file data and holes
Since version 3.1, Linux supports the following additional values for
if (!(ret & MEMBARRIER_CMD_GLOBAL)) {
fprintf(stderr,
- "membarrier does not support MEMBARRIER_CMD_GLOBAL\\n");
+ "membarrier does not support MEMBARRIER_CMD_GLOBAL\en");
return \-1;
}
#include <string.h>
#include <stdio.h>
-#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\
+#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e
} while (0)
int
ssize_t len;
if (argc < 3) {
- fprintf(stderr, "%s name size [seals]\\n", argv[0]);
- fprintf(stderr, "\\t\(aqseals\(aq can contain any of the "
- "following characters:\\n");
- fprintf(stderr, "\\t\\tg \- F_SEAL_GROW\\n");
- fprintf(stderr, "\\t\\ts \- F_SEAL_SHRINK\\n");
- fprintf(stderr, "\\t\\tw \- F_SEAL_WRITE\\n");
- fprintf(stderr, "\\t\\tS \- F_SEAL_SEAL\\n");
+ fprintf(stderr, "%s name size [seals]\en", argv[0]);
+ fprintf(stderr, "\et\(aqseals\(aq can contain any of the "
+ "following characters:\en");
+ fprintf(stderr, "\et\etg \- F_SEAL_GROW\en");
+ fprintf(stderr, "\et\ets \- F_SEAL_SHRINK\en");
+ fprintf(stderr, "\et\etw \- F_SEAL_WRITE\en");
+ fprintf(stderr, "\et\etS \- F_SEAL_SEAL\en");
exit(EXIT_FAILURE);
}
if (ftruncate(fd, len) == \-1)
errExit("truncate");
- printf("PID: %ld; fd: %d; /proc/%ld/fd/%d\\n",
+ printf("PID: %ld; fd: %d; /proc/%ld/fd/%d\en",
(long) getpid(), fd, (long) getpid(), fd);
/* Code to map the file and populate the mapping with data
#include <string.h>
#include <stdio.h>
-#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\
+#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e
} while (0)
int
unsigned int seals;
if (argc != 2) {
- fprintf(stderr, "%s /proc/PID/fd/FD\\n", argv[0]);
+ fprintf(stderr, "%s /proc/PID/fd/FD\en", argv[0]);
exit(EXIT_FAILURE);
}
printf(" WRITE");
if (seals & F_SEAL_SHRINK)
printf(" SHRINK");
- printf("\\n");
+ printf("\en");
/* Code to map the file and access the contents of the
resulting mapping omitted */
#include <stdlib.h>
#include <unistd.h>
-#define handle_error(msg) \\
+#define handle_error(msg) \e
do { perror(msg); exit(EXIT_FAILURE); } while (0)
int
ssize_t s;
if (argc < 3 || argc > 4) {
- fprintf(stderr, "%s file offset [length]\\n", argv[0]);
+ fprintf(stderr, "%s file offset [length]\en", argv[0]);
exit(EXIT_FAILURE);
}
/* offset for mmap() must be page aligned */
if (offset >= sb.st_size) {
- fprintf(stderr, "offset is past end of file\\n");
+ fprintf(stderr, "offset is past end of file\en");
exit(EXIT_FAILURE);
}
#include <errno.h>
#include <sys/mman.h>
-#define handle_error(msg) \\
+#define handle_error(msg) \e
do { perror(msg); exit(EXIT_FAILURE); } while (0)
static char *buffer;
Nevertheless, we use printf() here as a simple way of
showing that the handler was called. */
- printf("Got SIGSEGV at address: 0x%lx\\n",
+ printf("Got SIGSEGV at address: 0x%lx\en",
(long) si\->si_addr);
exit(EXIT_FAILURE);
}
if (buffer == NULL)
handle_error("memalign");
- printf("Start of region: 0x%lx\\n", (long) buffer);
+ printf("Start of region: 0x%lx\en", (long) buffer);
if (mprotect(buffer + pagesize * 2, pagesize,
PROT_READ) == \-1)
for (p = buffer ; ; )
*(p++) = \(aqa\(aq;
- printf("Loop completed\\n"); /* Should never happen */
+ printf("Loop completed\en"); /* Should never happen */
exit(EXIT_SUCCESS);
}
.EE
if (msg != NULL)
fputs(msg, stderr);
- fprintf(stderr, "Usage: %s [options]\\n", prog_name);
- fprintf(stderr, "Options are:\\n");
- fprintf(stderr, "\-s send message using msgsnd()\\n");
- fprintf(stderr, "\-r read message using msgrcv()\\n");
- fprintf(stderr, "\-t message type (default is 1)\\n");
- fprintf(stderr, "\-k message queue key (default is 1234)\\n");
+ fprintf(stderr, "Usage: %s [options]\en", prog_name);
+ fprintf(stderr, "Options are:\en");
+ fprintf(stderr, "\-s send message using msgsnd()\en");
+ fprintf(stderr, "\-r read message using msgrcv()\en");
+ fprintf(stderr, "\-t message type (default is 1)\en");
+ fprintf(stderr, "\-k message queue key (default is 1234)\en");
exit(EXIT_FAILURE);
}
perror("msgsnd error");
exit(EXIT_FAILURE);
}
- printf("sent: %s\\n", msg.mtext);
+ printf("sent: %s\en", msg.mtext);
}
static void
perror("msgrcv");
exit(EXIT_FAILURE);
}
- printf("No message available for msgrcv()\\n");
+ printf("No message available for msgrcv()\en");
} else
- printf("message received: %s\\n", msg.mtext);
+ printf("message received: %s\en", msg.mtext);
}
int
case \(aqt\(aq:
msgtype = atoi(optarg);
if (msgtype <= 0)
- usage(argv[0], "\-t option must be greater than 0\\n");
+ usage(argv[0], "\-t option must be greater than 0\en");
break;
case \(aqk\(aq:
msgkey = atoi(optarg);
break;
default:
- usage(argv[0], "Unrecognized option\\n");
+ usage(argv[0], "Unrecognized option\en");
}
}
if (mode == 0)
- usage(argv[0], "must use either \-s or \-r option\\n");
+ usage(argv[0], "must use either \-s or \-r option\en");
qid = msgget(msgkey, IPC_CREAT | 0666);
.PP
.in +4n
.EX
-$ \fBstat \-\-printf="%i\\n" cecilia.txt\fP # Display inode number
+$ \fBstat \-\-printf="%i\en" cecilia.txt\fP # Display inode number
4072121
$ \fBrm cecilia.txt\fP
$ \fBecho 'Can you please think about it?' > cecilia.txt\fP
-$ \fBstat \-\-printf="%i\\n" cecilia.txt\fP # Check inode number
+$ \fBstat \-\-printf="%i\en" cecilia.txt\fP # Check inode number
4072121
$ \fBsudo ./t_open_by_handle_at < fh\fP
open_by_handle_at: Stale NFS file handle
#include <errno.h>
#include <string.h>
-#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\
+#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e
} while (0)
int
char *pathname;
if (argc != 2) {
- fprintf(stderr, "Usage: %s pathname\\n", argv[0]);
+ fprintf(stderr, "Usage: %s pathname\en", argv[0]);
exit(EXIT_FAILURE);
}
fhp\->handle_bytes = 0;
if (name_to_handle_at(dirfd, pathname, fhp,
&mount_id, flags) != \-1 || errno != EOVERFLOW) {
- fprintf(stderr, "Unexpected result from name_to_handle_at()\\n");
+ fprintf(stderr, "Unexpected result from name_to_handle_at()\en");
exit(EXIT_FAILURE);
}
/* Write mount ID, file handle size, and file handle to stdout,
for later reuse by t_open_by_handle_at.c */
- printf("%d\\n", mount_id);
+ printf("%d\en", mount_id);
printf("%d %d ", fhp\->handle_bytes, fhp\->handle_type);
for (j = 0; j < fhp\->handle_bytes; j++)
printf(" %02x", fhp\->f_handle[j]);
- printf("\\n");
+ printf("\en");
exit(EXIT_SUCCESS);
}
#include <unistd.h>
#include <string.h>
-#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\
+#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e
} while (0)
/* Scan /proc/self/mountinfo to find the line whose mount ID matches
nread = sscanf(linep, "%d %*d %*s %*s %s",
&mi_mount_id, mount_path);
if (nread != 2) {
- fprintf(stderr, "Bad sscanf()\\n");
+ fprintf(stderr, "Bad sscanf()\en");
exit(EXIT_FAILURE);
}
fclose(fp);
if (!found) {
- fprintf(stderr, "Could not find mount point\\n");
+ fprintf(stderr, "Could not find mount point\en");
exit(EXIT_FAILURE);
}
char *nextp;
if ((argc > 1 && strcmp(argv[1], "\-\-help") == 0) || argc > 2) {
- fprintf(stderr, "Usage: %s [mount\-path]\\n", argv[0]);
+ fprintf(stderr, "Usage: %s [mount\-path]\en", argv[0]);
exit(EXIT_FAILURE);
}
if ((fgets(line1, sizeof(line1), stdin) == NULL) ||
(fgets(line2, sizeof(line2), stdin) == NULL)) {
- fprintf(stderr, "Missing mount_id / file handle\\n");
+ fprintf(stderr, "Missing mount_id / file handle\en");
exit(EXIT_FAILURE);
}
if (nread == \-1)
errExit("read");
- printf("Read %zd bytes\\n", nread);
+ printf("Read %zd bytes\en", nread);
exit(EXIT_SUCCESS);
}
fd = perf_event_open(&pe, 0, \-1, \-1, 0);
if (fd == \-1) {
- fprintf(stderr, "Error opening leader %llx\\n", pe.config);
+ fprintf(stderr, "Error opening leader %llx\en", pe.config);
exit(EXIT_FAILURE);
}
ioctl(fd, PERF_EVENT_IOC_RESET, 0);
ioctl(fd, PERF_EVENT_IOC_ENABLE, 0);
- printf("Measuring instruction count for this printf\\n");
+ printf("Measuring instruction count for this printf\en");
ioctl(fd, PERF_EVENT_IOC_DISABLE, 0);
read(fd, &count, sizeof(long long));
- printf("Used %lld instructions\\n", count);
+ printf("Used %lld instructions\en", count);
close(fd);
}
char buf;
if (argc != 2) {
- fprintf(stderr, "Usage: %s <string>\\n", argv[0]);
+ fprintf(stderr, "Usage: %s <string>\en", argv[0]);
exit(EXIT_FAILURE);
}
while (read(pipefd[0], &buf, 1) > 0)
write(STDOUT_FILENO, &buf, 1);
- write(STDOUT_FILENO, "\\n", 1);
+ write(STDOUT_FILENO, "\en", 1);
close(pipefd[0]);
_exit(EXIT_SUCCESS);
.I d_reclen
is the size of
.IR d_name ,
-not counting the terminating null byte (\(aq\\0\(aq).
+not counting the terminating null byte (\(aq\e0\(aq).
.I d_name
is a null-terminated filename.
.SH RETURN VALUE
ssize_t nbytes, bufsiz;
if (argc != 2) {
- fprintf(stderr, "Usage: %s <pathname>\\n", argv[0]);
+ fprintf(stderr, "Usage: %s <pathname>\en", argv[0]);
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}
- printf("\(aq%s\(aq points to \(aq%.*s\(aq\\n", argv[1], (int) nbytes, buf);
+ printf("\(aq%s\(aq points to \(aq%.*s\(aq\en", argv[1], (int) nbytes, buf);
/* If the return value was equal to the buffer size, then the
the link target was larger than expected (perhaps because the
been truncated. */
if (nbytes == bufsiz)
- printf("(Returned buffer may have been truncated)\\n");
+ printf("(Returned buffer may have been truncated)\en");
free(buf);
exit(EXIT_SUCCESS);
.in +4n
.EX
char *str0 = "hello ";
-char *str1 = "world\\n";
+char *str1 = "world\en";
struct iovec iov[2];
ssize_t nwritten;
exit(EXIT_FAILURE);
}
- printf("%d messages received\\n", retval);
+ printf("%d messages received\en", retval);
for (i = 0; i < retval; i++) {
bufs[i][msgs[i].msg_len] = 0;
printf("%d %s", i+1, bufs[i]);
.in +4n
.EX
$ sudo sh
-# \fBecho 'create user mtk:* * /bin/keyctl instantiate %k %c %S' \\\fP
+# \fBecho 'create user mtk:* * /bin/keyctl instantiate %k %c %S' \e\fP
\fB> /etc/request-key.conf\fP
# \fBexit\fP
.EE
key_serial_t key;
if (argc != 4) {
- fprintf(stderr, "Usage: %s type description callout\-data\\n",
+ fprintf(stderr, "Usage: %s type description callout\-data\en",
argv[0]);
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}
- printf("Key ID is %lx\\n", (long) key);
+ printf("Key ID is %lx\en", (long) key);
exit(EXIT_SUCCESS);
}
#include <unistd.h>
#include <sys/wait.h>
-#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\
+#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e
} while (0)
int
int nloops, j;
if (argc != 4) {
- fprintf(stderr, "Usage: %s parent\-cpu child\-cpu num\-loops\\n",
+ fprintf(stderr, "Usage: %s parent\-cpu child\-cpu num\-loops\en",
argv[0]);
exit(EXIT_FAILURE);
}
$ \fBuname -m\fP
x86_64
$ \fBsyscall_nr() {
- cat /usr/src/linux/arch/x86/syscalls/syscall_64.tbl | \\
+ cat /usr/src/linux/arch/x86/syscalls/syscall_64.tbl | \e
awk '$2 != "x32" && $3 == "'$1'" { print $1 }'
}\fP
.EE
{
if (argc < 5) {
fprintf(stderr, "Usage: "
- "%s <syscall_nr> <arch> <errno> <prog> [<args>]\\n"
- "Hint for <arch>: AUDIT_ARCH_I386: 0x%X\\n"
- " AUDIT_ARCH_X86_64: 0x%X\\n"
- "\\n", argv[0], AUDIT_ARCH_I386, AUDIT_ARCH_X86_64);
+ "%s <syscall_nr> <arch> <errno> <prog> [<args>]\en"
+ "Hint for <arch>: AUDIT_ARCH_I386: 0x%X\en"
+ " AUDIT_ARCH_X86_64: 0x%X\en"
+ "\en", argv[0], AUDIT_ARCH_I386, AUDIT_ARCH_X86_64);
exit(EXIT_FAILURE);
}
if (retval == \-1)
perror("select()");
else if (retval)
- printf("Data is available now.\\n");
+ printf("Data is available now.\en");
/* FD_ISSET(0, &rfds) will be true. */
else
- printf("No data within five seconds.\\n");
+ printf("No data within five seconds.\en");
exit(EXIT_SUCCESS);
}
return \-1;
}
- printf("accepting connections on port %d\\n", listen_port);
+ printf("accepting connections on port %d\en", listen_port);
listen(lfd, 10);
return lfd;
}
addr.sin_family = AF_INET;
if (!inet_aton(address, (struct in_addr *) &addr.sin_addr.s_addr)) {
- fprintf(stderr, "inet_aton(): bad IP address format\\n");
+ fprintf(stderr, "inet_aton(): bad IP address format\en");
close(cfd);
return \-1;
}
return cfd;
}
-#define SHUT_FD1 do { \\
- if (fd1 >= 0) { \\
- shutdown(fd1, SHUT_RDWR); \\
- close(fd1); \\
- fd1 = \-1; \\
- } \\
+#define SHUT_FD1 do { \e
+ if (fd1 >= 0) { \e
+ shutdown(fd1, SHUT_RDWR); \e
+ close(fd1); \e
+ fd1 = \-1; \e
+ } \e
} while (0)
-#define SHUT_FD2 do { \\
- if (fd2 >= 0) { \\
- shutdown(fd2, SHUT_RDWR); \\
- close(fd2); \\
- fd2 = \-1; \\
- } \\
+#define SHUT_FD2 do { \e
+ if (fd2 >= 0) { \e
+ shutdown(fd2, SHUT_RDWR); \e
+ close(fd2); \e
+ fd2 = \-1; \e
+ } \e
} while (0)
#define BUF_SIZE 1024
int buf2_avail = 0, buf2_written = 0;
if (argc != 4) {
- fprintf(stderr, "Usage\\n\\tfwd <listen\-port> "
- "<forward\-to\-port> <forward\-to\-ip\-address>\\n");
+ fprintf(stderr, "Usage\en\etfwd <listen\-port> "
+ "<forward\-to\-port> <forward\-to\-ip\-address>\en");
exit(EXIT_FAILURE);
}
if (fd2 == \-1)
SHUT_FD1;
else
- printf("connect from %s\\n",
+ printf("connect from %s\en",
inet_ntoa(client_addr.sin_addr));
/* Skip any events on the old, closed file descriptors. */
if (retval == \-1)
perror("sendmmsg()");
else
- printf("%d messages sent\\n", retval);
+ printf("%d messages sent\en", retval);
exit(0);
}
#include <stdlib.h>
#include <stdio.h>
-#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\
+#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e
} while (0)
int
int fd;
if (argc < 3) {
- fprintf(stderr, "%s /proc/PID/ns/FILE cmd args...\\n", argv[0]);
+ fprintf(stderr, "%s /proc/PID/ns/FILE cmd args...\en", argv[0]);
exit(EXIT_FAILURE);
}
Got SIGINT
.B ^C
Got SIGINT
-\fB^\\\fP # Control\-\\ generates SIGQUIT
+\fB^\e\fP # Control\-\e generates SIGQUIT
Got SIGQUIT
$
.EE
#include <stdlib.h>
#include <stdio.h>
-#define handle_error(msg) \\
+#define handle_error(msg) \e
do { perror(msg); exit(EXIT_FAILURE); } while (0)
int
handle_error("read");
if (fdsi.ssi_signo == SIGINT) {
- printf("Got SIGINT\\n");
+ printf("Got SIGINT\en");
} else if (fdsi.ssi_signo == SIGQUIT) {
- printf("Got SIGQUIT\\n");
+ printf("Got SIGQUIT\en");
exit(EXIT_SUCCESS);
} else {
- printf("Read unexpected signal\\n");
+ printf("Read unexpected signal\en");
}
}
}
#include <sys/types.h>
#include <fcntl.h>
-#define handle_error(msg) \\
+#define handle_error(msg) \e
do { perror(msg); exit(EXIT_FAILURE); } while (0)
int main(void)
* 0x00000002 (spu was stopped due to stop\-and\-signal)
* | 0x12340000 (the stop\-and\-signal code)
*/
- printf("SPU Status: 0x%08x\\n", spu_status);
+ printf("SPU Status: 0x%08x\en", spu_status);
exit(EXIT_SUCCESS);
}
struct stat sb;
if (argc != 2) {
- fprintf(stderr, "Usage: %s <pathname>\\n", argv[0]);
+ fprintf(stderr, "Usage: %s <pathname>\en", argv[0]);
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}
- printf("ID of containing device: [%lx,%lx]\\n",
+ printf("ID of containing device: [%lx,%lx]\en",
(long) major(sb.st_dev), (long) minor(sb.st_dev));
printf("File type: ");
switch (sb.st_mode & S_IFMT) {
- case S_IFBLK: printf("block device\\n"); break;
- case S_IFCHR: printf("character device\\n"); break;
- case S_IFDIR: printf("directory\\n"); break;
- case S_IFIFO: printf("FIFO/pipe\\n"); break;
- case S_IFLNK: printf("symlink\\n"); break;
- case S_IFREG: printf("regular file\\n"); break;
- case S_IFSOCK: printf("socket\\n"); break;
- default: printf("unknown?\\n"); break;
+ case S_IFBLK: printf("block device\en"); break;
+ case S_IFCHR: printf("character device\en"); break;
+ case S_IFDIR: printf("directory\en"); break;
+ case S_IFIFO: printf("FIFO/pipe\en"); break;
+ case S_IFLNK: printf("symlink\en"); break;
+ case S_IFREG: printf("regular file\en"); break;
+ case S_IFSOCK: printf("socket\en"); break;
+ default: printf("unknown?\en"); break;
}
- printf("I\-node number: %ld\\n", (long) sb.st_ino);
+ printf("I\-node number: %ld\en", (long) sb.st_ino);
- printf("Mode: %lo (octal)\\n",
+ printf("Mode: %lo (octal)\en",
(unsigned long) sb.st_mode);
- printf("Link count: %ld\\n", (long) sb.st_nlink);
- printf("Ownership: UID=%ld GID=%ld\\n",
+ printf("Link count: %ld\en", (long) sb.st_nlink);
+ printf("Ownership: UID=%ld GID=%ld\en",
(long) sb.st_uid, (long) sb.st_gid);
- printf("Preferred I/O block size: %ld bytes\\n",
+ printf("Preferred I/O block size: %ld bytes\en",
(long) sb.st_blksize);
- printf("File size: %lld bytes\\n",
+ printf("File size: %lld bytes\en",
(long long) sb.st_size);
- printf("Blocks allocated: %lld\\n",
+ printf("Blocks allocated: %lld\en",
(long long) sb.st_blocks);
printf("Last status change: %s", ctime(&sb.st_ctime));
perror("_sysctl");
exit(EXIT_FAILURE);
}
- printf("This machine is running %*s\\n", osnamelth, osname);
+ printf("This machine is running %*s\en", osnamelth, osname);
exit(EXIT_SUCCESS);
}
.EE
int len, slen;
if (argc != 2) {
- fprintf(stderr, "Usage: %s <file>\\n", argv[0]);
+ fprintf(stderr, "Usage: %s <file>\en", argv[0]);
exit(EXIT_FAILURE);
}
#define CLOCKID CLOCK_REALTIME
#define SIG SIGRTMIN
-#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\
+#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e
} while (0)
static void
tidp = si\->si_value.sival_ptr;
printf(" sival_ptr = %p; ", si\->si_value.sival_ptr);
- printf(" *sival_ptr = 0x%lx\\n", (long) *tidp);
+ printf(" *sival_ptr = 0x%lx\en", (long) *tidp);
or = timer_getoverrun(*tidp);
if (or == \-1)
errExit("timer_getoverrun");
else
- printf(" overrun count = %d\\n", or);
+ printf(" overrun count = %d\en", or);
}
static void
Nevertheless, we use printf() here as a simple way of
showing that the handler was called. */
- printf("Caught signal %d\\n", sig);
+ printf("Caught signal %d\en", sig);
print_siginfo(si);
signal(sig, SIG_IGN);
}
struct sigaction sa;
if (argc != 3) {
- fprintf(stderr, "Usage: %s <sleep\-secs> <freq\-nanosecs>\\n",
+ fprintf(stderr, "Usage: %s <sleep\-secs> <freq\-nanosecs>\en",
argv[0]);
exit(EXIT_FAILURE);
}
/* Establish handler for timer signal */
- printf("Establishing handler for signal %d\\n", SIG);
+ printf("Establishing handler for signal %d\en", SIG);
sa.sa_flags = SA_SIGINFO;
sa.sa_sigaction = handler;
sigemptyset(&sa.sa_mask);
/* Block timer signal temporarily */
- printf("Blocking signal %d\\n", SIG);
+ printf("Blocking signal %d\en", SIG);
sigemptyset(&mask);
sigaddset(&mask, SIG);
if (sigprocmask(SIG_SETMASK, &mask, NULL) == \-1)
if (timer_create(CLOCKID, &sev, &timerid) == \-1)
errExit("timer_create");
- printf("timer ID is 0x%lx\\n", (long) timerid);
+ printf("timer ID is 0x%lx\en", (long) timerid);
/* Start the timer */
/* Sleep for a while; meanwhile, the timer may expire
multiple times */
- printf("Sleeping for %d seconds\\n", atoi(argv[1]));
+ printf("Sleeping for %d seconds\en", atoi(argv[1]));
sleep(atoi(argv[1]));
/* Unlock the timer signal, so that timer notification
can be delivered */
- printf("Unblocking signal %d\\n", SIG);
+ printf("Unblocking signal %d\en", SIG);
if (sigprocmask(SIG_UNBLOCK, &mask, NULL) == \-1)
errExit("sigprocmask");
#include <stdio.h>
#include <stdint.h> /* Definition of uint64_t */
-#define handle_error(msg) \\
+#define handle_error(msg) \e
do { perror(msg); exit(EXIT_FAILURE); } while (0)
static void
ssize_t s;
if ((argc != 2) && (argc != 4)) {
- fprintf(stderr, "%s init\-secs [interval\-secs max\-exp]\\n",
+ fprintf(stderr, "%s init\-secs [interval\-secs max\-exp]\en",
argv[0]);
exit(EXIT_FAILURE);
}
handle_error("timerfd_settime");
print_elapsed_time();
- printf("timer started\\n");
+ printf("timer started\en");
for (tot_exp = 0; tot_exp < max_exp;) {
s = read(fd, &exp, sizeof(uint64_t));
tot_exp += exp;
print_elapsed_time();
- printf("read: %llu; total=%llu\\n",
+ printf("read: %llu; total=%llu\en",
(unsigned long long) exp,
(unsigned long long) tot_exp);
}
.PP
If the file previously was larger than this size, the extra data is lost.
If the file previously was shorter, it is extended, and
-the extended part reads as null bytes (\(aq\\0\(aq).
+the extended part reads as null bytes (\(aq\e0\(aq).
.PP
The file offset is not changed.
.PP
The length of the arrays in a
.I struct utsname
is unspecified (see NOTES);
-the fields are terminated by a null byte (\(aq\\0\(aq).
+the fields are terminated by a null byte (\(aq\e0\(aq).
.SH RETURN VALUE
On success, zero is returned.
On error, \-1 is returned, and
/* A simple error\-handling function: print an error message based
on the value in \(aqerrno\(aq and terminate the calling process */
-#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\
+#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e
} while (0)
static void
usage(char *pname)
{
- fprintf(stderr, "Usage: %s [options] program [arg...]\\n", pname);
- fprintf(stderr, "Options can be:\\n");
- fprintf(stderr, " \-i unshare IPC namespace\\n");
- fprintf(stderr, " \-m unshare mount namespace\\n");
- fprintf(stderr, " \-n unshare network namespace\\n");
- fprintf(stderr, " \-p unshare PID namespace\\n");
- fprintf(stderr, " \-u unshare UTS namespace\\n");
- fprintf(stderr, " \-U unshare user namespace\\n");
+ fprintf(stderr, "Usage: %s [options] program [arg...]\en", pname);
+ fprintf(stderr, "Options can be:\en");
+ fprintf(stderr, " \-i unshare IPC namespace\en");
+ fprintf(stderr, " \-m unshare mount namespace\en");
+ fprintf(stderr, " \-n unshare network namespace\en");
+ fprintf(stderr, " \-p unshare PID namespace\en");
+ fprintf(stderr, " \-u unshare UTS namespace\en");
+ fprintf(stderr, " \-U unshare user namespace\en");
exit(EXIT_FAILURE);
}
#include <sys/ioctl.h>
#include <poll.h>
-#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\
+#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e
} while (0)
static int page_size;
if (nready == \-1)
errExit("poll");
- printf("\\nfault_handler_thread():\\n");
+ printf("\enfault_handler_thread():\en");
printf(" poll() returns: nready = %d; "
- "POLLIN = %d; POLLERR = %d\\n", nready,
+ "POLLIN = %d; POLLERR = %d\en", nready,
(pollfd.revents & POLLIN) != 0,
(pollfd.revents & POLLERR) != 0);
nread = read(uffd, &msg, sizeof(msg));
if (nread == 0) {
- printf("EOF on userfaultfd!\\n");
+ printf("EOF on userfaultfd!\en");
exit(EXIT_FAILURE);
}
/* We expect only one kind of event; verify that assumption */
if (msg.event != UFFD_EVENT_PAGEFAULT) {
- fprintf(stderr, "Unexpected event on userfaultfd\\n");
+ fprintf(stderr, "Unexpected event on userfaultfd\en");
exit(EXIT_FAILURE);
}
printf(" UFFD_EVENT_PAGEFAULT event: ");
printf("flags = %llx; ", msg.arg.pagefault.flags);
- printf("address = %llx\\n", msg.arg.pagefault.address);
+ printf("address = %llx\en", msg.arg.pagefault.address);
/* Copy the page pointed to by \(aqpage\(aq into the faulting
region. Vary the contents that are copied in, so that it
if (ioctl(uffd, UFFDIO_COPY, &uffdio_copy) == \-1)
errExit("ioctl\-UFFDIO_COPY");
- printf(" (uffdio_copy.copy returned %lld)\\n",
+ printf(" (uffdio_copy.copy returned %lld)\en",
uffdio_copy.copy);
}
}
int s;
if (argc != 2) {
- fprintf(stderr, "Usage: %s num\-pages\\n", argv[0]);
+ fprintf(stderr, "Usage: %s num\-pages\en", argv[0]);
exit(EXIT_FAILURE);
}
if (addr == MAP_FAILED)
errExit("mmap");
- printf("Address returned by mmap() = %p\\n", addr);
+ printf("Address returned by mmap() = %p\en", addr);
/* Register the memory range of the mapping we just created for
handling by the userfaultfd object. In mode, we request to track
while (l < len) {
char c = addr[l];
printf("Read address %p in main(): ", addr + l);
- printf("%c\\n", c);
+ printf("%c\en", c);
l += 1024;
usleep(100000); /* Slow things down a little */
}
and
.IR f_fpack ,
are not implemented and will
-always be filled with null bytes (\(aq\\0\(aq).
+always be filled with null bytes (\(aq\e0\(aq).
.SH RETURN VALUE
On success, zero is returned and the
.I ustat
}
if (cpid == 0) { /* Code executed by child */
- printf("Child PID is %ld\\n", (long) getpid());
+ printf("Child PID is %ld\en", (long) getpid());
if (argc == 1)
pause(); /* Wait for signals */
_exit(atoi(argv[1]));
}
if (WIFEXITED(wstatus)) {
- printf("exited, status=%d\\n", WEXITSTATUS(wstatus));
+ printf("exited, status=%d\en", WEXITSTATUS(wstatus));
} else if (WIFSIGNALED(wstatus)) {
- printf("killed by signal %d\\n", WTERMSIG(wstatus));
+ printf("killed by signal %d\en", WTERMSIG(wstatus));
} else if (WIFSTOPPED(wstatus)) {
- printf("stopped by signal %d\\n", WSTOPSIG(wstatus));
+ printf("stopped by signal %d\en", WSTOPSIG(wstatus));
} else if (WIFCONTINUED(wstatus)) {
- printf("continued\\n");
+ printf("continued\en");
}
} while (!WIFEXITED(wstatus) && !WIFSIGNALED(wstatus));
exit(EXIT_SUCCESS);
int num_cpus, cpu;
if (argc < 2) {
- fprintf(stderr, "Usage: %s <num\-cpus>\\n", argv[0]);
+ fprintf(stderr, "Usage: %s <num\-cpus>\en", argv[0]);
exit(EXIT_FAILURE);
}
for (cpu = 0; cpu < num_cpus; cpu += 2)
CPU_SET_S(cpu, size, cpusetp);
- printf("CPU_COUNT() of set: %d\\n", CPU_COUNT_S(size, cpusetp));
+ printf("CPU_COUNT() of set: %d\en", CPU_COUNT_S(size, cpusetp));
CPU_FREE(cpusetp);
exit(EXIT_SUCCESS);
uint64_t tb1, tb2, diff;
uint64_t freq = __ppc_get_timebase_freq();
- printf("Time Base frequency = %"PRIu64" Hz\\n", freq);
+ printf("Time Base frequency = %"PRIu64" Hz\en", freq);
tb1 = __ppc_get_timebase();
diff = (MAX_TB \- tb2) + tb1;
}
- printf("Elapsed time = %1.2f usecs\\n",
+ printf("Elapsed time = %1.2f usecs\en",
(double) diff * 1000000 / freq );
exit(EXIT_SUCCESS);
.PP
An argz vector is a pointer to a character buffer together with a length.
The intended interpretation of the character buffer is an array
-of strings, where the strings are separated by null bytes (\(aq\\0\(aq).
+of strings, where the strings are separated by null bytes (\(aq\e0\(aq).
If the length is nonzero, the last byte of the buffer must be a null byte.
.PP
These functions are for handling argz vectors.
.PP
.BR argz_count ()
counts the number of strings, that is,
-the number of null bytes (\(aq\\0\(aq), in
+the number of null bytes (\(aq\e0\(aq), in
.RI ( argz ,\ argz_len ).
.PP
.BR argz_create ()
is the opposite of
.BR argz_create_sep ().
It transforms the argz vector into a normal string by replacing
-all null bytes (\(aq\\0\(aq) except the last by
+all null bytes (\(aq\e0\(aq) except the last by
.IR sep .
.SH RETURN VALUE
All argz functions that do memory allocation have a return type of
and
.BR vsprintf (3),
except that they allocate a string large enough to hold the output
-including the terminating null byte (\(aq\\0\(aq),
+including the terminating null byte (\(aq\e0\(aq),
and return a pointer to it via the first argument.
This pointer should be passed to
.BR free (3)
char **strings;
nptrs = backtrace(buffer, BT_BUF_SIZE);
- printf("backtrace() returned %d addresses\\n", nptrs);
+ printf("backtrace() returned %d addresses\en", nptrs);
/* The call backtrace_symbols_fd(buffer, nptrs, STDOUT_FILENO)
would produce similar output to the following: */
}
for (j = 0; j < nptrs; j++)
- printf("%s\\n", strings[j]);
+ printf("%s\en", strings[j]);
free(strings);
}
main(int argc, char *argv[])
{
if (argc != 2) {
- fprintf(stderr, "%s num\-calls\\n", argv[0]);
+ fprintf(stderr, "%s num\-calls\en", argv[0]);
exit(EXIT_FAILURE);
}
basec = strdup(path);
dname = dirname(dirc);
bname = basename(basec);
-printf("dirname=%s, basename=%s\\n", dname, bname);
+printf("dirname=%s, basename=%s\en", dname, bname);
.EE
.in
.SH SEE ALSO
uint64_t x;
if (argc != 2) {
- fprintf(stderr, "Usage: %s <num>\\n", argv[0]);
+ fprintf(stderr, "Usage: %s <num>\en", argv[0]);
exit(EXIT_FAILURE);
}
x = strtoul(argv[1], NULL, 0);
- printf("0x%" PRIx64 " ==> 0x%" PRIx64 "\\n", x, bswap_64(x));
+ printf("0x%" PRIx64 " ==> 0x%" PRIx64 "\en", x, bswap_64(x));
exit(EXIT_SUCCESS);
}
.I n
bytes of the memory starting at the location pointed to by
.IR s ,
-by writing zeros (bytes containing \(aq\\0\(aq) to that area.
+by writing zeros (bytes containing \(aq\e0\(aq) to that area.
.PP
The
.BR explicit_bzero ()
double complex i = I;
if (argc != 3) {
- fprintf(stderr, "Usage: %s <real> <imag>\\n", argv[0]);
+ fprintf(stderr, "Usage: %s <real> <imag>\en", argv[0]);
exit(EXIT_FAILURE);
}
c = cacos(z);
- printf("cacos() = %6.3f %6.3f*i\\n", creal(c), cimag(c));
+ printf("cacos() = %6.3f %6.3f*i\en", creal(c), cimag(c));
f = \-i * clog(z + i * csqrt(1 \- z * z));
- printf("formula = %6.3f %6.3f*i\\n", creal(f), cimag(f));
+ printf("formula = %6.3f %6.3f*i\en", creal(f), cimag(f));
exit(EXIT_SUCCESS);
}
double complex z, c, f;
if (argc != 3) {
- fprintf(stderr, "Usage: %s <real> <imag>\\n", argv[0]);
+ fprintf(stderr, "Usage: %s <real> <imag>\en", argv[0]);
exit(EXIT_FAILURE);
}
z = atof(argv[1]) + atof(argv[2]) * I;
c = cacosh(z);
- printf("cacosh() = %6.3f %6.3f*i\\n", creal(c), cimag(c));
+ printf("cacosh() = %6.3f %6.3f*i\en", creal(c), cimag(c));
f = 2 * clog(csqrt((z + 1)/2) + csqrt((z \- 1)/2));
- printf("formula = %6.3f %6.3f*i\\n", creal(f2), cimag(f2));
+ printf("formula = %6.3f %6.3f*i\en", creal(f2), cimag(f2));
exit(EXIT_SUCCESS);
}
double complex i = I;
if (argc != 3) {
- fprintf(stderr, "Usage: %s <real> <imag>\\n", argv[0]);
+ fprintf(stderr, "Usage: %s <real> <imag>\en", argv[0]);
exit(EXIT_FAILURE);
}
z = atof(argv[1]) + atof(argv[2]) * I;
c = catan(z);
- printf("catan() = %6.3f %6.3f*i\\n", creal(c), cimag(c));
+ printf("catan() = %6.3f %6.3f*i\en", creal(c), cimag(c));
f = (clog(1 + i * z) \- clog(1 \- i * z)) / (2 * i);
- printf("formula = %6.3f %6.3f*i\\n", creal(f2), cimag(f2));
+ printf("formula = %6.3f %6.3f*i\en", creal(f2), cimag(f2));
exit(EXIT_SUCCESS);
}
double complex z, c, f;
if (argc != 3) {
- fprintf(stderr, "Usage: %s <real> <imag>\\n", argv[0]);
+ fprintf(stderr, "Usage: %s <real> <imag>\en", argv[0]);
exit(EXIT_FAILURE);
}
z = atof(argv[1]) + atof(argv[2]) * I;
c = catanh(z);
- printf("catanh() = %6.3f %6.3f*i\\n", creal(c), cimag(c));
+ printf("catanh() = %6.3f %6.3f*i\en", creal(c), cimag(c));
f = 0.5 * (clog(1 + z) \- clog(1 \- z));
- printf("formula = %6.3f %6.3f*i\\n", creal(f2), cimag(f2));
+ printf("formula = %6.3f %6.3f*i\en", creal(f2), cimag(f2));
exit(EXIT_SUCCESS);
}
message-text is contained in an internal buffer area and should be copied by
the application if it is to be saved or modified.
The return string is
-always terminated with a null byte (\(aq\\0\(aq).
+always terminated with a null byte (\(aq\e0\(aq).
.SH RETURN VALUE
.PP
On success,
struct timespec ts;
if (argc != 2) {
- fprintf(stderr, "%s <process\-ID>\\n", argv[0]);
+ fprintf(stderr, "%s <process\-ID>\en", argv[0]);
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}
- printf("CPU-time clock for PID %s is %ld.%09ld seconds\\n",
+ printf("CPU-time clock for PID %s is %ld.%09ld seconds\en",
argv[1], (long) ts.tv_sec, (long) ts.tv_nsec);
exit(EXIT_SUCCESS);
}
.I buf
truncated to
.I len \- 1
-bytes if necessary, with a null byte (\(aq\\0\(aq) as terminator.
+bytes if necessary, with a null byte (\(aq\e0\(aq) as terminator.
This can be detected by comparing the return value of
.BR confstr ()
against
.PP
.in +4n
.EX
-"Wed Jun 30 21:49:08 1993\\n"
+"Wed Jun 30 21:49:08 1993\en"
.EE
.in
.PP
char *type;
int p_type, j;
- printf("Name: \\"%s\\" (%d segments)\\n", info\->dlpi_name,
+ printf("Name: \e"%s\e" (%d segments)\en", info\->dlpi_name,
info\->dlpi_phnum);
for (j = 0; j < info\->dlpi_phnum; j++) {
info\->dlpi_phdr[j].p_memsz,
info\->dlpi_phdr[j].p_flags);
if (type != NULL)
- printf("%s\\n", type);
+ printf("%s\en", type);
else
- printf("[other (0x%x)]\\n", p_type);
+ printf("[other (0x%x)]\en", p_type);
}
return 0;
int j;
if (argc != 2) {
- fprintf(stderr, "Usage: %s <libpath>\\n", argv[0]);
+ fprintf(stderr, "Usage: %s <libpath>\en", argv[0]);
exit(EXIT_FAILURE);
}
handle = dlopen(argv[1], RTLD_NOW);
if (handle == NULL) {
- fprintf(stderr, "dlopen() failed: %s\\n", dlerror());
+ fprintf(stderr, "dlopen() failed: %s\en", dlerror());
exit(EXIT_FAILURE);
}
RTLD_DI_SERINFO */
if (dlinfo(handle, RTLD_DI_SERINFOSIZE, &serinfo) == \-1) {
- fprintf(stderr, "RTLD_DI_SERINFOSIZE failed: %s\\n", dlerror());
+ fprintf(stderr, "RTLD_DI_SERINFOSIZE failed: %s\en", dlerror());
exit(EXIT_FAILURE);
}
allocated buffer */
if (dlinfo(handle, RTLD_DI_SERINFOSIZE, sip) == \-1) {
- fprintf(stderr, "RTLD_DI_SERINFOSIZE failed: %s\\n", dlerror());
+ fprintf(stderr, "RTLD_DI_SERINFOSIZE failed: %s\en", dlerror());
exit(EXIT_FAILURE);
}
/* Fetch and print library search list */
if (dlinfo(handle, RTLD_DI_SERINFO, sip) == \-1) {
- fprintf(stderr, "RTLD_DI_SERINFO failed: %s\\n", dlerror());
+ fprintf(stderr, "RTLD_DI_SERINFO failed: %s\en", dlerror());
exit(EXIT_FAILURE);
}
for (j = 0; j < serinfo.dls_cnt; j++)
- printf("dls_serpath[%d].dls_name = %s\\n",
+ printf("dls_serpath[%d].dls_name = %s\en",
j, sip\->dls_serpath[j].dls_name);
exit(EXIT_SUCCESS);
#include <stdlib.h>
#include <locale.h>
-#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\
+#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e
} while (0)
int
char *p;
if (argc != 2) {
- fprintf(stderr, "Usage: %s string\\n", argv[0]);
+ fprintf(stderr, "Usage: %s string\en", argv[0]);
exit(EXIT_FAILURE);
}
for (p = argv[1]; *p; p++)
putchar(toupper_l(*p, nloc));
- printf("\\n");
+ printf("\en");
freelocale(nloc);
}
setkey(key);
}
- printf("Before encrypting: %s\\n", orig);
+ printf("Before encrypting: %s\en", orig);
encrypt(buf, 0);
for (i = 0; i < 8; i++) {
- for (j = 0, txt[i] = \(aq\\0\(aq; j < 8; j++) {
+ for (j = 0, txt[i] = \(aq\e0\(aq; j < 8; j++) {
txt[i] |= buf[i * 8 + j] << j;
}
- txt[8] = \(aq\\0\(aq;
+ txt[8] = \(aq\e0\(aq;
}
- printf("After encrypting: %s\\n", txt);
+ printf("After encrypting: %s\en", txt);
encrypt(buf, 1);
for (i = 0; i < 8; i++) {
- for (j = 0, txt[i] = \(aq\\0\(aq; j < 8; j++) {
+ for (j = 0, txt[i] = \(aq\e0\(aq; j < 8; j++) {
txt[i] |= buf[i * 8 + j] << j;
}
- txt[8] = \(aq\\0\(aq;
+ txt[8] = \(aq\e0\(aq;
}
- printf("After decrypting: %s\\n", txt);
+ printf("After decrypting: %s\en", txt);
exit(EXIT_SUCCESS);
}
.EE
int
main(int argc, char *argv[])
{
- printf("First address past:\\n");
- printf(" program text (etext) %10p\\n", &etext);
- printf(" initialized data (edata) %10p\\n", &edata);
- printf(" uninitialized data (end) %10p\\n", &end);
+ printf("First address past:\en");
+ printf(" program text (etext) %10p\en", &etext);
+ printf(" initialized data (edata) %10p\en", &edata);
+ printf(" uninitialized data (end) %10p\en", &end);
exit(EXIT_SUCCESS);
}
x.arr[2] = 0x33;
x.arr[3] = 0x44; /* Highest-address byte */
- printf("x.u32 = 0x%x\\n", x.u32);
- printf("htole32(x.u32) = 0x%x\\n", htole32(x.u32));
- printf("htobe32(x.u32) = 0x%x\\n", htobe32(x.u32));
+ printf("x.u32 = 0x%x\en", x.u32);
+ printf("htole32(x.u32) = 0x%x\en", htole32(x.u32));
+ printf("htobe32(x.u32) = 0x%x\en", htobe32(x.u32));
exit(EXIT_SUCCESS);
}
function.
It reads a string of at most \fIn\-1\fP wide characters into the
wide-character array pointed to by \fIws\fP,
-and adds a terminating null wide character (L\(aq\\0\(aq).
+and adds a terminating null wide character (L\(aq\e0\(aq).
It stops reading wide characters after it has encountered and
stored a newline wide character.
It also stops when end of stream is reached.
.I w+
Open the stream for reading and writing.
The buffer contents are truncated
-(i.e., \(aq\\0\(aq is placed in the first byte of the buffer).
+(i.e., \(aq\e0\(aq is placed in the first byte of the buffer).
.TP
.I a+
Append; open the stream for reading and writing,
to allow for this.
.PP
In a stream opened for reading,
-null bytes (\(aq\\0\(aq) in the buffer do not cause read
+null bytes (\(aq\e0\(aq) in the buffer do not cause read
operations to return an end-of-file indication.
A read from the buffer will indicate end-of-file
only when the current buffer position advances
#include <stdio.h>
#include <stdlib.h>
-#define handle_error(msg) \\
+#define handle_error(msg) \e
do { perror(msg); exit(EXIT_FAILURE); } while (0)
int
char *ptr;
if (argc != 2) {
- fprintf(stderr, "Usage: %s \(aq<num>...\(aq\\n", argv[0]);
+ fprintf(stderr, "Usage: %s \(aq<num>...\(aq\en", argv[0]);
exit(EXIT_FAILURE);
}
fclose(in);
fclose(out);
- printf("size=%zu; ptr=%s\\n", size, ptr);
+ printf("size=%zu; ptr=%s\en", size, ptr);
free(ptr);
exit(EXIT_SUCCESS);
exit(EXIT_FAILURE);
}
if (nread == 0) {
- printf("Reached end of file\\n");
+ printf("Reached end of file\en");
break;
}
- printf("/%.*s/\\n", nread, buf);
+ printf("/%.*s/\en", nread, buf);
}
exit(EXIT_SUCCESS);
.BR fputs (3)
function.
It writes the wide-character string starting at \fIws\fP, up to but
-not including the terminating null wide character (L\(aq\\0\(aq), to \fIstream\fP.
+not including the terminating null wide character (L\(aq\e0\(aq), to \fIstream\fP.
.PP
For a nonlocking counterpart, see
.BR unlocked_stdio (3).
x = strtod(argv[1], NULL);
r = frexp(x, &exp);
- printf("frexp(%g, &e) = %g: %g * %d^%d = %g\\n",
+ printf("frexp(%g, &e) = %g: %g * %d^%d = %g\en",
x, r, r, FLT_RADIX, exp, x);
exit(EXIT_SUCCESS);
}
else
printf("%7jd", (intmax_t) sb\->st_size);
- printf(" %\-40s %d %s\\n",
+ printf(" %\-40s %d %s\en",
fpath, ftwbuf\->base, fpath + ftwbuf\->base);
return 0; /* To tell nftw() to continue */
main(int argc, char *argv[])
{
printf("This system has %d processors configured and "
- "%d processors available.\\n",
+ "%d processors available.\en",
get_nprocs_conf(), get_nprocs());
exit(EXIT_SUCCESS);
}
main(int argc, char *argv[])
{
printf("This system has %ld pages of physical memory and "
- "%ld pages of physical memory available.\\n",
+ "%ld pages of physical memory available.\en",
get_phys_pages(), get_avphys_pages());
exit(EXIT_SUCCESS);
}
char buf[BUF_SIZE];
if (argc != 2) {
- fprintf(stderr, "Usage: %s port\\n", argv[0]);
+ fprintf(stderr, "Usage: %s port\en", argv[0]);
exit(EXIT_FAILURE);
}
s = getaddrinfo(NULL, argv[1], &hints, &result);
if (s != 0) {
- fprintf(stderr, "getaddrinfo: %s\\n", gai_strerror(s));
+ fprintf(stderr, "getaddrinfo: %s\en", gai_strerror(s));
exit(EXIT_FAILURE);
}
}
if (rp == NULL) { /* No address succeeded */
- fprintf(stderr, "Could not bind\\n");
+ fprintf(stderr, "Could not bind\en");
exit(EXIT_FAILURE);
}
peer_addr_len, host, NI_MAXHOST,
service, NI_MAXSERV, NI_NUMERICSERV);
if (s == 0)
- printf("Received %zd bytes from %s:%s\\n",
+ printf("Received %zd bytes from %s:%s\en",
nread, host, service);
else
- fprintf(stderr, "getnameinfo: %s\\n", gai_strerror(s));
+ fprintf(stderr, "getnameinfo: %s\en", gai_strerror(s));
if (sendto(sfd, buf, nread, 0,
(struct sockaddr *) &peer_addr,
peer_addr_len) != nread)
- fprintf(stderr, "Error sending response\\n");
+ fprintf(stderr, "Error sending response\en");
}
}
.EE
char buf[BUF_SIZE];
if (argc < 3) {
- fprintf(stderr, "Usage: %s host port msg...\\n", argv[0]);
+ fprintf(stderr, "Usage: %s host port msg...\en", argv[0]);
exit(EXIT_FAILURE);
}
s = getaddrinfo(argv[1], argv[2], &hints, &result);
if (s != 0) {
- fprintf(stderr, "getaddrinfo: %s\\n", gai_strerror(s));
+ fprintf(stderr, "getaddrinfo: %s\en", gai_strerror(s));
exit(EXIT_FAILURE);
}
}
if (rp == NULL) { /* No address succeeded */
- fprintf(stderr, "Could not connect\\n");
+ fprintf(stderr, "Could not connect\en");
exit(EXIT_FAILURE);
}
if (len > BUF_SIZE) {
fprintf(stderr,
- "Ignoring long message in argument %d\\n", j);
+ "Ignoring long message in argument %d\en", j);
continue;
}
if (write(sfd, argv[j], len) != len) {
- fprintf(stderr, "partial/failed write\\n");
+ fprintf(stderr, "partial/failed write\en");
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}
- printf("Received %zd bytes: %s\\n", nread, buf);
+ printf("Received %zd bytes: %s\en", nread, buf);
}
exit(EXIT_SUCCESS);
struct addrinfo *res;
if (argc < 2) {
- fprintf(stderr, "Usage: %s HOST...\\n", argv[0]);
+ fprintf(stderr, "Usage: %s HOST...\en", argv[0]);
exit(EXIT_FAILURE);
}
ret = getaddrinfo_a(GAI_WAIT, reqs, argc \- 1, NULL);
if (ret != 0) {
- fprintf(stderr, "getaddrinfo_a() failed: %s\\n",
+ fprintf(stderr, "getaddrinfo_a() failed: %s\en",
gai_strerror(ret));
exit(EXIT_FAILURE);
}
host, sizeof(host),
NULL, 0, NI_NUMERICHOST);
if (ret != 0) {
- fprintf(stderr, "getnameinfo() failed: %s\\n",
+ fprintf(stderr, "getnameinfo() failed: %s\en",
gai_strerror(ret));
exit(EXIT_FAILURE);
}
if (fgets(buf, sizeof(buf), stdin) == NULL)
return NULL;
- if (buf[strlen(buf) \- 1] == \(aq\\n\(aq)
+ if (buf[strlen(buf) \- 1] == \(aq\en\(aq)
buf[strlen(buf) \- 1] = 0;
return buf;
ret = getaddrinfo_a(GAI_NOWAIT, &reqs[nreqs_base],
nreqs \- nreqs_base, NULL);
if (ret) {
- fprintf(stderr, "getaddrinfo_a() failed: %s\\n",
+ fprintf(stderr, "getaddrinfo_a() failed: %s\en",
gai_strerror(ret));
exit(EXIT_FAILURE);
}
n = atoi(id);
if (n >= nreqs) {
- printf("Bad request number: %s\\n", id);
+ printf("Bad request number: %s\en", id);
return;
}
ret = gai_suspend(wait_reqs, nreqs, NULL);
if (ret) {
- printf("gai_suspend(): %s\\n", gai_strerror(ret));
+ printf("gai_suspend(): %s\en", gai_strerror(ret));
return;
}
if (ret == EAI_INPROGRESS)
continue;
- printf("[%02d] %s: %s\\n", i, reqs[i]\->ar_name,
+ printf("[%02d] %s: %s\en", i, reqs[i]\->ar_name,
ret == 0 ? "Finished" : gai_strerror(ret));
}
}
n = atoi(id);
if (n >= nreqs) {
- printf("Bad request number: %s\\n", id);
+ printf("Bad request number: %s\en", id);
return;
}
ret = gai_cancel(reqs[n]);
- printf("[%s] %s: %s\\n", id, reqs[atoi(id)]\->ar_name,
+ printf("[%s] %s: %s\en", id, reqs[atoi(id)]\->ar_name,
gai_strerror(ret));
}
}
host, sizeof(host),
NULL, 0, NI_NUMERICHOST);
if (ret) {
- fprintf(stderr, "getnameinfo() failed: %s\\n",
+ fprintf(stderr, "getnameinfo() failed: %s\en",
gai_strerror(ret));
exit(EXIT_FAILURE);
}
list_requests();
break;
default:
- fprintf(stderr, "Bad command: %c\\n", cmd[0]);
+ fprintf(stderr, "Bad command: %c\en", cmd[0]);
break;
}
}
tmp = getdate(argv[j]);
if (tmp == NULL) {
- printf("Call %d failed; getdate_err = %d\\n",
+ printf("Call %d failed; getdate_err = %d\en",
j, getdate_err);
continue;
}
- printf("Call %d (\\"%s\\") succeeded:\\n", j, argv[j]);
- printf(" tm_sec = %d\\n", tmp\->tm_sec);
- printf(" tm_min = %d\\n", tmp\->tm_min);
- printf(" tm_hour = %d\\n", tmp\->tm_hour);
- printf(" tm_mday = %d\\n", tmp\->tm_mday);
- printf(" tm_mon = %d\\n", tmp\->tm_mon);
- printf(" tm_year = %d\\n", tmp\->tm_year);
- printf(" tm_wday = %d\\n", tmp\->tm_wday);
- printf(" tm_yday = %d\\n", tmp\->tm_yday);
- printf(" tm_isdst = %d\\n", tmp\->tm_isdst);
+ printf("Call %d (\e"%s\e") succeeded:\en", j, argv[j]);
+ printf(" tm_sec = %d\en", tmp\->tm_sec);
+ printf(" tm_min = %d\en", tmp\->tm_min);
+ printf(" tm_hour = %d\en", tmp\->tm_hour);
+ printf(" tm_mday = %d\en", tmp\->tm_mday);
+ printf(" tm_mon = %d\en", tmp\->tm_mon);
+ printf(" tm_year = %d\en", tmp\->tm_year);
+ printf(" tm_wday = %d\en", tmp\->tm_wday);
+ printf(" tm_yday = %d\en", tmp\->tm_yday);
+ printf(" tm_isdst = %d\en", tmp\->tm_isdst);
}
exit(EXIT_SUCCESS);
struct group *gr;
if (argc != 3) {
- fprintf(stderr, "Usage: %s <user> <ngroups>\\n", argv[0]);
+ fprintf(stderr, "Usage: %s <user> <ngroups>\en", argv[0]);
exit(EXIT_FAILURE);
}
/* Retrieve group list */
if (getgrouplist(argv[1], pw\->pw_gid, groups, &ngroups) == \-1) {
- fprintf(stderr, "getgrouplist() returned \-1; ngroups = %d\\n",
+ fprintf(stderr, "getgrouplist() returned \-1; ngroups = %d\en",
ngroups);
exit(EXIT_FAILURE);
}
/* Display list of retrieved groups, along with group names */
- fprintf(stderr, "ngroups = %d\\n", ngroups);
+ fprintf(stderr, "ngroups = %d\en", ngroups);
for (j = 0; j < ngroups; j++) {
printf("%d", groups[j]);
gr = getgrgid(groups[j]);
if (gr != NULL)
printf(" (%s)", gr\->gr_name);
- printf("\\n");
+ printf("\en");
}
exit(EXIT_SUCCESS);
/* Display interface name and family (including symbolic
form of the latter for the common families) */
- printf("%\-8s %s (%d)\\n",
+ printf("%\-8s %s (%d)\en",
ifa\->ifa_name,
(family == AF_PACKET) ? "AF_PACKET" :
(family == AF_INET) ? "AF_INET" :
host, NI_MAXHOST,
NULL, 0, NI_NUMERICHOST);
if (s != 0) {
- printf("getnameinfo() failed: %s\\n", gai_strerror(s));
+ printf("getnameinfo() failed: %s\en", gai_strerror(s));
exit(EXIT_FAILURE);
}
- printf("\\t\\taddress: <%s>\\n", host);
+ printf("\et\etaddress: <%s>\en", host);
} else if (family == AF_PACKET && ifa\->ifa_data != NULL) {
struct rtnl_link_stats *stats = ifa\->ifa_data;
- printf("\\t\\ttx_packets = %10u; rx_packets = %10u\\n"
- "\\t\\ttx_bytes = %10u; rx_bytes = %10u\\n",
+ printf("\et\ettx_packets = %10u; rx_packets = %10u\en"
+ "\et\ettx_bytes = %10u; rx_bytes = %10u\en",
stats\->tx_packets, stats\->rx_packets,
stats\->tx_bytes, stats\->rx_bytes);
}
and
.BR getdelim ()
return the number of characters read, including the delimiter character,
-but not including the terminating null byte (\(aq\\0\(aq).
+but not including the terminating null byte (\(aq\e0\(aq).
This value can be used
to handle embedded null bytes in the line read.
.PP
.TP
.B ERANGE
(getlogin_r)
-The length of the username, including the terminating null byte (\(aq\\0\(aq),
+The length of the username, including the terminating null byte (\(aq\e0\(aq),
is larger than
.IR bufsize .
.PP
tfnd = 1;
break;
default: /* \(aq?\(aq */
- fprintf(stderr, "Usage: %s [\-t nsecs] [\-n] name\\n",
+ fprintf(stderr, "Usage: %s [\-t nsecs] [\-n] name\en",
argv[0]);
exit(EXIT_FAILURE);
}
}
- printf("flags=%d; tfnd=%d; nsecs=%d; optind=%d\\n",
+ printf("flags=%d; tfnd=%d; nsecs=%d; optind=%d\en",
flags, tfnd, nsecs, optind);
if (optind >= argc) {
- fprintf(stderr, "Expected argument after options\\n");
+ fprintf(stderr, "Expected argument after options\en");
exit(EXIT_FAILURE);
}
- printf("name argument = %s\\n", argv[optind]);
+ printf("name argument = %s\en", argv[optind]);
/* Other code omitted */
printf("option %s", long_options[option_index].name);
if (optarg)
printf(" with arg %s", optarg);
- printf("\\n");
+ printf("\en");
break;
case \(aq0\(aq:
case \(aq1\(aq:
case \(aq2\(aq:
if (digit_optind != 0 && digit_optind != this_option_optind)
- printf("digits occur in two different argv\-elements.\\n");
+ printf("digits occur in two different argv\-elements.\en");
digit_optind = this_option_optind;
- printf("option %c\\n", c);
+ printf("option %c\en", c);
break;
case \(aqa\(aq:
- printf("option a\\n");
+ printf("option a\en");
break;
case \(aqb\(aq:
- printf("option b\\n");
+ printf("option b\en");
break;
case \(aqc\(aq:
- printf("option c with value \(aq%s\(aq\\n", optarg);
+ printf("option c with value \(aq%s\(aq\en", optarg);
break;
case \(aqd\(aq:
- printf("option d with value \(aq%s\(aq\\n", optarg);
+ printf("option d with value \(aq%s\(aq\en", optarg);
break;
case \(aq?\(aq:
break;
default:
- printf("?? getopt returned character code 0%o ??\\n", c);
+ printf("?? getopt returned character code 0%o ??\en", c);
}
}
printf("non\-option ARGV\-elements: ");
while (optind < argc)
printf("%s ", argv[optind++]);
- printf("\\n");
+ printf("\en");
}
exit(EXIT_SUCCESS);
returns a pointer to a static buffer containing (the first
.B PASS_MAX
bytes of) the password without the trailing
-newline, terminated by a null byte (\(aq\\0\(aq).
+newline, terminated by a null byte (\(aq\e0\(aq).
This buffer may be overwritten by a following call.
On error, the terminal state is restored,
.I errno
char **p;
if (argc < 2) {
- printf("Usage: %s proto\-name [buflen]\\n", argv[0]);
+ printf("Usage: %s proto\-name [buflen]\en", argv[0]);
exit(EXIT_FAILURE);
}
buflen = atoi(argv[2]);
if (buflen > MAX_BUF) {
- printf("Exceeded buffer limit (%d)\\n", MAX_BUF);
+ printf("Exceeded buffer limit (%d)\en", MAX_BUF);
exit(EXIT_FAILURE);
}
buf, buflen, &result);
if (s == ERANGE) {
if (erange_cnt == 0)
- printf("ERANGE! Retrying with larger buffer\\n");
+ printf("ERANGE! Retrying with larger buffer\en");
erange_cnt++;
/* Increment a byte at a time so we can see exactly
buflen++;
if (buflen > MAX_BUF) {
- printf("Exceeded buffer limit (%d)\\n", MAX_BUF);
+ printf("Exceeded buffer limit (%d)\en", MAX_BUF);
exit(EXIT_FAILURE);
}
}
} while (s == ERANGE);
- printf("getprotobyname_r() returned: %s (buflen=%d)\\n",
+ printf("getprotobyname_r() returned: %s (buflen=%d)\en",
(s == 0) ? "0 (success)" : (s == ENOENT) ? "ENOENT" :
strerror(s), buflen);
if (s != 0 || result == NULL) {
- printf("Call failed/record not found\\n");
+ printf("Call failed/record not found\en");
exit(EXIT_FAILURE);
}
result_buf.p_name, result_buf.p_proto);
for (p = result_buf.p_aliases; *p != NULL; p++)
printf("%s ", *p);
- printf("\\n");
+ printf("\en");
exit(EXIT_SUCCESS);
}
int s;
if (argc != 2) {
- fprintf(stderr, "Usage: %s username\\n", argv[0]);
+ fprintf(stderr, "Usage: %s username\en", argv[0]);
exit(EXIT_FAILURE);
}
s = getpwnam_r(argv[1], &pwd, buf, bufsize, &result);
if (result == NULL) {
if (s == 0)
- printf("Not found\\n");
+ printf("Not found\en");
else {
errno = s;
perror("getpwnam_r");
exit(EXIT_FAILURE);
}
- printf("Name: %s; UID: %ld\\n", pwd.pw_gecos, (long) pwd.pw_uid);
+ printf("Name: %s; UID: %ld\en", pwd.pw_gecos, (long) pwd.pw_uid);
exit(EXIT_SUCCESS);
}
.EE
char **p;
if (argc < 3) {
- printf("Usage: %s port\-num proto\-name [buflen]\\n", argv[0]);
+ printf("Usage: %s port\-num proto\-name [buflen]\en", argv[0]);
exit(EXIT_FAILURE);
}
buflen = atoi(argv[3]);
if (buflen > MAX_BUF) {
- printf("Exceeded buffer limit (%d)\\n", MAX_BUF);
+ printf("Exceeded buffer limit (%d)\en", MAX_BUF);
exit(EXIT_FAILURE);
}
buf, buflen, &result);
if (s == ERANGE) {
if (erange_cnt == 0)
- printf("ERANGE! Retrying with larger buffer\\n");
+ printf("ERANGE! Retrying with larger buffer\en");
erange_cnt++;
/* Increment a byte at a time so we can see exactly
buflen++;
if (buflen > MAX_BUF) {
- printf("Exceeded buffer limit (%d)\\n", MAX_BUF);
+ printf("Exceeded buffer limit (%d)\en", MAX_BUF);
exit(EXIT_FAILURE);
}
}
} while (s == ERANGE);
- printf("getservbyport_r() returned: %s (buflen=%d)\\n",
+ printf("getservbyport_r() returned: %s (buflen=%d)\en",
(s == 0) ? "0 (success)" : (s == ENOENT) ? "ENOENT" :
strerror(s), buflen);
if (s != 0 || result == NULL) {
- printf("Call failed/record not found\\n");
+ printf("Call failed/record not found\en");
exit(EXIT_FAILURE);
}
ntohs(result_buf.s_port));
for (p = result_buf.s_aliases; *p != NULL; p++)
printf("%s ", *p);
- printf("\\n");
+ printf("\en");
exit(EXIT_SUCCESS);
}
returns,
.I optionp
points to the next suboption,
-or to the null byte (\(aq\\0\(aq) at the end of the
+or to the null byte (\(aq\e0\(aq) at the end of the
string if the last suboption was just processed.
.SH RETURN VALUE
If the first suboption in
switch (opt) {
case \(aqo\(aq:
subopts = optarg;
- while (*subopts != \(aq\\0\(aq && !errfnd) {
+ while (*subopts != \(aq\e0\(aq && !errfnd) {
switch (getsubopt(&subopts, token, &value)) {
case RO_OPT:
case NAME_OPT:
if (value == NULL) {
fprintf(stderr, "Missing value for "
- "suboption \(aq%s\(aq\\n", token[NAME_OPT]);
+ "suboption \(aq%s\(aq\en", token[NAME_OPT]);
errfnd = 1;
continue;
}
default:
fprintf(stderr, "No match found "
- "for token: /%s/\\n", value);
+ "for token: /%s/\en", value);
errfnd = 1;
break;
}
}
if (readwrite && readonly) {
fprintf(stderr, "Only one of \(aq%s\(aq and \(aq%s\(aq can be "
- "specified\\n", token[RO_OPT], token[RW_OPT]);
+ "specified\en", token[RO_OPT], token[RW_OPT]);
errfnd = 1;
}
break;
}
if (errfnd || argc == 1) {
- fprintf(stderr, "\\nUsage: %s \-o <suboptstring>\\n", argv[0]);
+ fprintf(stderr, "\enUsage: %s \-o <suboptstring>\en", argv[0]);
fprintf(stderr, "suboptions are \(aqro\(aq, \(aqrw\(aq, "
- "and \(aqname=<value>\(aq\\n");
+ "and \(aqname=<value>\(aq\en");
exit(EXIT_FAILURE);
}
.BR glob ().
.TP
.B GLOB_NOESCAPE
-Don't allow backslash (\(aq\\\(aq) to be used as an escape
+Don't allow backslash (\(aq\e\(aq) to be used as an escape
character.
Normally, a backslash can be used to quote the following character,
providing a mechanism to turn off the special meaning
int
main(int argc, char *argv[])
{
- printf("GNU libc version: %s\\n", gnu_get_libc_version());
- printf("GNU libc release: %s\\n", gnu_get_libc_release());
+ printf("GNU libc version: %s\en", gnu_get_libc_version());
+ printf("GNU libc release: %s\en", gnu_get_libc_release());
exit(EXIT_SUCCESS);
}
.EE
ep = hsearch(e, ENTER);
/* there should be no failures */
if (ep == NULL) {
- fprintf(stderr, "entry failed\\n");
+ fprintf(stderr, "entry failed\en");
exit(EXIT_FAILURE);
}
}
show that two are not in the table */
e.key = data[i];
ep = hsearch(e, FIND);
- printf("%9.9s \-> %9.9s:%d\\n", e.key,
+ printf("%9.9s \-> %9.9s:%d\en", e.key,
ep ? ep\->key : "NULL", ep ? (int)(ep\->data) : 0);
}
hdestroy();
}
for (i = if_ni; ! (i\->if_index == 0 && i\->if_name == NULL); i++)
- printf("%u: %s\\n", i\->if_index, i\->if_name);
+ printf("%u: %s\en", i\->if_index, i\->if_name);
if_freenameindex(if_ni);
function returns a pointer to the last occurrence
of the character \fIc\fP in the string \fIs\fP.
.PP
-The terminating null byte (\(aq\\0\(aq) is considered to be a part of the
+The terminating null byte (\(aq\e0\(aq) is considered to be a part of the
strings.
.SH RETURN VALUE
The
struct in_addr addr;
if (argc != 2) {
- fprintf(stderr, "%s <dotted\-address>\\n", argv[0]);
+ fprintf(stderr, "%s <dotted\-address>\en", argv[0]);
exit(EXIT_FAILURE);
}
if (inet_aton(argv[1], &addr) == 0) {
- fprintf(stderr, "Invalid address\\n");
+ fprintf(stderr, "Invalid address\en");
exit(EXIT_FAILURE);
}
- printf("%s\\n", inet_ntoa(addr));
+ printf("%s\en", inet_ntoa(addr));
exit(EXIT_SUCCESS);
}
.EE
#include <stdio.h>
#include <stdlib.h>
-#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\
+#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e
} while (0)
int
if (argc < 2) {
fprintf(stderr,
- "Usage: %s presentation\-form [addr\-init\-value]\\n",
+ "Usage: %s presentation\-form [addr\-init\-value]\en",
argv[0]);
exit(EXIT_FAILURE);
}
if (bits == \-1)
errExit("inet_net_ntop");
- printf("inet_net_pton() returned: %d\\n", bits);
+ printf("inet_net_pton() returned: %d\en", bits);
/* Convert binary format back to presentation, using \(aqbits\(aq
returned by inet_net_pton() */
if (inet_net_ntop(AF_INET, &addr, bits, buf, sizeof(buf)) == NULL)
errExit("inet_net_ntop");
- printf("inet_net_ntop() yielded: %s\\n", buf);
+ printf("inet_net_ntop() yielded: %s\en", buf);
/* Display \(aqaddr\(aq in raw form (in network byte order), so we can
see bytes not displayed by inet_net_ntop(); some of those bytes
may not have been touched by inet_net_ntop(), and so will still
have any initial value that was specified in argv[2]. */
- printf("Raw address: %x\\n", htonl(addr.s_addr));
+ printf("Raw address: %x\en", htonl(addr.s_addr));
exit(EXIT_SUCCESS);
}
char str[INET6_ADDRSTRLEN];
if (argc != 3) {
- fprintf(stderr, "Usage: %s {i4|i6|<num>} string\\n", argv[0]);
+ fprintf(stderr, "Usage: %s {i4|i6|<num>} string\en", argv[0]);
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}
- printf("%s\\n", str);
+ printf("%s\en", str);
exit(EXIT_SUCCESS);
}
e = malloc(sizeof(struct element));
if (e == NULL) {
- fprintf(stderr, "malloc() failed\\n");
+ fprintf(stderr, "malloc() failed\en");
exit(EXIT_FAILURE);
}
}
if (errfnd || optind >= argc) {
- fprintf(stderr, "Usage: %s [\-c] string...\\n", argv[0]);
+ fprintf(stderr, "Usage: %s [\-c] string...\en", argv[0]);
exit(EXIT_FAILURE);
}
/* Traverse the list from the start, printing element names */
- printf("Traversing completed list:\\n");
+ printf("Traversing completed list:\en");
elem = first;
do {
- printf(" %s\\n", elem\->name);
+ printf(" %s\en", elem\->name);
elem = elem\->forward;
} while (elem != NULL && elem != first);
if (elem == first)
- printf("That was a circular list\\n");
+ printf("That was a circular list\en");
exit(EXIT_SUCCESS);
}
.PP
The wide-character class "blank" always contains
at least the space character
-and the control character \(aq\\t\(aq.
+and the control character \(aq\et\(aq.
.SH RETURN VALUE
The
.BR iswblank ()
.PP
The wide-character class "space" always contains at least the space character
and the control
-characters \(aq\\f\(aq, \(aq\\n\(aq, \(aq\\r\(aq, \(aq\\t\(aq, \(aq\\v\(aq.
+characters \(aq\ef\(aq, \(aq\en\(aq, \(aq\er\(aq, \(aq\et\(aq, \(aq\ev\(aq.
.SH RETURN VALUE
The
.BR iswspace ()
static ucontext_t uctx_main, uctx_func1, uctx_func2;
-#define handle_error(msg) \\
+#define handle_error(msg) \e
do { perror(msg); exit(EXIT_FAILURE); } while (0)
static void
func1(void)
{
- printf("func1: started\\n");
- printf("func1: swapcontext(&uctx_func1, &uctx_func2)\\n");
+ printf("func1: started\en");
+ printf("func1: swapcontext(&uctx_func1, &uctx_func2)\en");
if (swapcontext(&uctx_func1, &uctx_func2) == \-1)
handle_error("swapcontext");
- printf("func1: returning\\n");
+ printf("func1: returning\en");
}
static void
func2(void)
{
- printf("func2: started\\n");
- printf("func2: swapcontext(&uctx_func2, &uctx_func1)\\n");
+ printf("func2: started\en");
+ printf("func2: swapcontext(&uctx_func2, &uctx_func1)\en");
if (swapcontext(&uctx_func2, &uctx_func1) == \-1)
handle_error("swapcontext");
- printf("func2: returning\\n");
+ printf("func2: returning\en");
}
int
uctx_func2.uc_link = (argc > 1) ? NULL : &uctx_func1;
makecontext(&uctx_func2, func2, 0);
- printf("main: swapcontext(&uctx_main, &uctx_func2)\\n");
+ printf("main: swapcontext(&uctx_main, &uctx_func2)\en");
if (swapcontext(&uctx_main, &uctx_func2) == \-1)
handle_error("swapcontext");
- printf("main: exiting\\n");
+ printf("main: exiting\en");
exit(EXIT_SUCCESS);
}
.EE
mi = mallinfo();
- printf("Total non\-mmapped bytes (arena): %d\\n", mi.arena);
- printf("# of free chunks (ordblks): %d\\n", mi.ordblks);
- printf("# of free fastbin blocks (smblks): %d\\n", mi.smblks);
- printf("# of mapped regions (hblks): %d\\n", mi.hblks);
- printf("Bytes in mapped regions (hblkhd): %d\\n", mi.hblkhd);
- printf("Max. total allocated space (usmblks): %d\\n", mi.usmblks);
- printf("Free bytes held in fastbins (fsmblks): %d\\n", mi.fsmblks);
- printf("Total allocated space (uordblks): %d\\n", mi.uordblks);
- printf("Total free space (fordblks): %d\\n", mi.fordblks);
- printf("Topmost releasable block (keepcost): %d\\n", mi.keepcost);
+ printf("Total non\-mmapped bytes (arena): %d\en", mi.arena);
+ printf("# of free chunks (ordblks): %d\en", mi.ordblks);
+ printf("# of free fastbin blocks (smblks): %d\en", mi.smblks);
+ printf("# of mapped regions (hblks): %d\en", mi.hblks);
+ printf("Bytes in mapped regions (hblkhd): %d\en", mi.hblkhd);
+ printf("Max. total allocated space (usmblks): %d\en", mi.usmblks);
+ printf("Free bytes held in fastbins (fsmblks): %d\en", mi.fsmblks);
+ printf("Total allocated space (uordblks): %d\en", mi.uordblks);
+ printf("Total free space (fordblks): %d\en", mi.fordblks);
+ printf("Topmost releasable block (keepcost): %d\en", mi.keepcost);
}
int
if (argc < 3 || strcmp(argv[1], "\-\-help") == 0) {
fprintf(stderr, "%s num\-blocks block\-size [free\-step "
- "[start\-free [end\-free]]]\\n", argv[0]);
+ "[start\-free [end\-free]]]\en", argv[0]);
exit(EXIT_FAILURE);
}
freeBegin = (argc > 4) ? atoi(argv[4]) : 0;
freeEnd = (argc > 5) ? atoi(argv[5]) : numBlocks;
- printf("============== Before allocating blocks ==============\\n");
+ printf("============== Before allocating blocks ==============\en");
display_mallinfo();
for (j = 0; j < numBlocks; j++) {
if (numBlocks >= MAX_ALLOCS) {
- fprintf(stderr, "Too many allocations\\n");
+ fprintf(stderr, "Too many allocations\en");
exit(EXIT_FAILURE);
}
}
}
- printf("\\n============== After allocating blocks ==============\\n");
+ printf("\en============== After allocating blocks ==============\en");
display_mallinfo();
for (j = freeBegin; j < freeEnd; j += freeStep)
free(alloc[j]);
- printf("\\n============== After freeing blocks ==============\\n");
+ printf("\en============== After freeing blocks ==============\en");
display_mallinfo();
exit(EXIT_SUCCESS);
old_malloc_hook = __malloc_hook;
/* printf() might call malloc(), so protect it too. */
- printf("malloc(%u) called from %p returns %p\\n",
+ printf("malloc(%u) called from %p returns %p\en",
(unsigned int) size, caller, result);
/* Restore our own hooks */
static size_t blockSize;
static int numThreads, numBlocks;
-#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\
+#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e
} while (0)
static void *
if (argc < 4) {
fprintf(stderr,
- "%s num\-threads num\-blocks block\-size [sleep\-time]\\n",
+ "%s num\-threads num\-blocks block\-size [sleep\-time]\en",
argv[0]);
exit(EXIT_FAILURE);
}
if (thr == NULL)
errExit("calloc");
- printf("============ Before allocating blocks ============\\n");
+ printf("============ Before allocating blocks ============\en");
malloc_info(0, stdout);
/* Create threads that allocate different amounts of memory */
sleep(2); /* Give all threads a chance to
complete allocations */
- printf("\\n============ After allocating blocks ============\\n");
+ printf("\en============ After allocating blocks ============\en");
malloc_info(0, stdout);
exit(EXIT_SUCCESS);
}
free(p);
- printf("main(): returned from first free() call\\n");
+ printf("main(): returned from first free() call\en");
free(p);
- printf("main(): returned from second free() call\\n");
+ printf("main(): returned from second free() call\en");
exit(EXIT_SUCCESS);
}
int
matherr(struct exception *exc)
{
- fprintf(stderr, "matherr %s exception in %s() function\\n",
+ fprintf(stderr, "matherr %s exception in %s() function\en",
(exc\->type == DOMAIN) ? "DOMAIN" :
(exc\->type == OVERFLOW) ? "OVERFLOW" :
(exc\->type == UNDERFLOW) ? "UNDERFLOW" :
(exc\->type == TLOSS) ? "TLOSS" :
(exc\->type == PLOSS) ? "PLOSS" : "???",
exc\->name);
- fprintf(stderr, " args: %f, %f\\n",
+ fprintf(stderr, " args: %f, %f\en",
exc\->arg1, exc\->arg2);
- fprintf(stderr, " retval: %f\\n", exc\->retval);
+ fprintf(stderr, " retval: %f\en", exc\->retval);
if (change_retval)
exc\->retval = new_retval;
if (argc < 2) {
fprintf(stderr, "Usage: %s <argval>"
- " [<matherr\-ret> [<new\-func\-retval>]]\\n", argv[0]);
+ " [<matherr\-ret> [<new\-func\-retval>]]\en", argv[0]);
exit(EXIT_FAILURE);
}
if (errno != 0)
perror("errno");
- printf("x=%f\\n", x);
+ printf("x=%f\en", x);
exit(EXIT_SUCCESS);
}
.EE
It updates the shift state
.IR *ps .
If the converted wide
-character is not L\(aq\\0\(aq (the null wide character),
+character is not L\(aq\e0\(aq (the null wide character),
it returns the number of bytes that were consumed
from
.IR s .
-If the converted wide character is L\(aq\\0\(aq, it resets the shift
+If the converted wide character is L\(aq\e0\(aq, it resets the shift
state
.I *ps
to the initial state and returns 0.
function returns the number of bytes parsed from the
multibyte sequence starting at
.IR s ,
-if a non-L\(aq\\0\(aq wide character
+if a non-L\(aq\e0\(aq wide character
was recognized.
-It returns 0, if a L\(aq\\0\(aq wide character was recognized.
+It returns 0, if a L\(aq\e0\(aq wide character was recognized.
It returns
.I (size_t)\ \-1
and sets
limit forces a stop,
or
.I len
-non-L\(aq\\0\(aq wide characters
+non-L\(aq\e0\(aq wide characters
have been stored at
.IR dest .
In this case,
is returned.
.IP 3.
The multibyte string has been completely converted, including the
-terminating null wide character (\(aq\\0\(aq)
+terminating null wide character (\(aq\e0\(aq)
(which has the side effect of bringing back
.I *ps
to the
.BR EILSEQ .
.IP 2.
.I len
-non-L\(aq\\0\(aq wide characters have been stored at
+non-L\(aq\e0\(aq wide characters have been stored at
.IR dest .
In this case,
.I *src
is returned.
.IP 3.
The multibyte string has been completely converted, including the
-terminating null wide character (\(aq\\0\(aq), which has the side
+terminating null wide character (\(aq\e0\(aq), which has the side
effect of bringing back
.I *ps
to the
is returned.
.IP 2.
.I n
-non-L\(aq\\0\(aq wide characters have been stored at
+non-L\(aq\e0\(aq wide characters have been stored at
.IR dest .
In this case, the number of wide characters written to
.I dest
shift state at this point is lost.
.IP 3.
The multibyte string has been completely converted, including the
-terminating null character (\(aq\\0\(aq).
+terminating null character (\(aq\e0\(aq).
In this case, the number of wide characters written to
.IR dest ,
excluding the terminating null wide character, is returned.
wchar_t *wp;
if (argc < 3) {
- fprintf(stderr, "Usage: %s <locale> <string>\\n", argv[0]);
+ fprintf(stderr, "Usage: %s <locale> <string>\en", argv[0]);
exit(EXIT_FAILURE);
}
/* Describe the source string to the user */
- printf("Length of source string (excluding terminator):\\n");
- printf(" %zu bytes\\n", strlen(argv[2]));
- printf(" %zu multibyte characters\\n\\n", mbslen);
+ printf("Length of source string (excluding terminator):\en");
+ printf(" %zu bytes\en", strlen(argv[2]));
+ printf(" %zu multibyte characters\en\en", mbslen);
/* Allocate wide character string of the desired size. Add 1
- to allow for terminating null wide character (L\(aq\\0\(aq). */
+ to allow for terminating null wide character (L\(aq\e0\(aq). */
wcs = calloc(mbslen + 1, sizeof(wchar_t));
if (wcs == NULL) {
exit(EXIT_FAILURE);
}
- printf("Wide character string is: %ls (%zu characters)\\n",
+ printf("Wide character string is: %ls (%zu characters)\en",
wcs, mbslen);
/* Now do some inspection of the classes of the characters in
printf("lower ");
}
- putchar(\(aq\\n\(aq);
+ putchar(\(aq\en\(aq);
}
exit(EXIT_SUCCESS);
function.
If
.I s
-does not point to a null byte (\(aq\\0\(aq), it returns the number
+does not point to a null byte (\(aq\e0\(aq), it returns the number
of bytes that were consumed from
.IR s ,
otherwise it returns 0.
char *p;
if (mcheck(NULL) != 0) {
- fprintf(stderr, "mcheck() failed\\n");
+ fprintf(stderr, "mcheck() failed\en");
exit(EXIT_FAILURE);
}
p = malloc(1000);
- fprintf(stderr, "About to free\\n");
+ fprintf(stderr, "About to free\en");
free(p);
- fprintf(stderr, "\\nAbout to free a second time\\n");
+ fprintf(stderr, "\enAbout to free a second time\en");
free(p);
exit(EXIT_SUCCESS);
.PP
.in +4n
.EX
-char *p = rawmemchr(s,\ \(aq\\0\(aq);
+char *p = rawmemchr(s,\ \(aq\e0\(aq);
.EE
.in
.SH RETURN VALUE
#include <stdlib.h>
#include <unistd.h>
-#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\
+#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e
} while (0)
int
struct mq_attr attr;
if (argc != 2) {
- fprintf(stderr, "Usage: %s mq\-name\\n", argv[0]);
+ fprintf(stderr, "Usage: %s mq\-name\en", argv[0]);
exit(EXIT_FAILURE);
}
if (mq_getattr(mqd, &attr) == \-1)
errExit("mq_getattr");
- printf("Maximum # of messages on queue: %ld\\n", attr.mq_maxmsg);
- printf("Maximum message size: %ld\\n", attr.mq_msgsize);
+ printf("Maximum # of messages on queue: %ld\en", attr.mq_maxmsg);
+ printf("Maximum message size: %ld\en", attr.mq_msgsize);
if (mq_unlink(argv[1]) == \-1)
errExit("mq_unlink");
#include <stdlib.h>
#include <unistd.h>
-#define handle_error(msg) \\
+#define handle_error(msg) \e
do { perror(msg); exit(EXIT_FAILURE); } while (0)
static void /* Thread start function */
if (nr == \-1)
handle_error("mq_receive");
- printf("Read %zd bytes from MQ\\n", nr);
+ printf("Read %zd bytes from MQ\en", nr);
free(buf);
exit(EXIT_SUCCESS); /* Terminate the process */
}
struct sigevent sev;
if (argc != 2) {
- fprintf(stderr, "Usage: %s <mq\-name>\\n", argv[0]);
+ fprintf(stderr, "Usage: %s <mq\-name>\en", argv[0]);
exit(EXIT_FAILURE);
}
#include <locale.h>
#include <time.h>
-#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\
+#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e
} while (0)
int
locale_t loc, nloc;
if (argc < 2) {
- fprintf(stderr, "Usage: %s locale1 [locale2]\\n", argv[0]);
+ fprintf(stderr, "Usage: %s locale1 [locale2]\en", argv[0]);
exit(EXIT_FAILURE);
}
/* Test effect of LC_NUMERIC */
- printf("%8.3f\\n", 123456.789);
+ printf("%8.3f\en", 123456.789);
/* Test effect of LC_TIME */
if (s == 0)
errExit("strftime");
- printf("%s\\n", buf);
+ printf("%s\en", buf);
/* Free the locale object */
setlocale(LC_CTYPE, "");
setlocale(LC_NUMERIC, "");
- printf("%s\\n", nl_langinfo(CODESET));
- printf("%s\\n", nl_langinfo(RADIXCHAR));
+ printf("%s\en", nl_langinfo(CODESET));
+ printf("%s\en", nl_langinfo(RADIXCHAR));
exit(EXIT_SUCCESS);
}
/* Output is compiler dependent */
- printf("offsets: i=%zd; c=%zd; d=%zd a=%zd\\n",
+ printf("offsets: i=%zd; c=%zd; d=%zd a=%zd\en",
offsetof(struct s, i), offsetof(struct s, c),
offsetof(struct s, d), offsetof(struct s, a));
- printf("sizeof(struct s)=%zd\\n", sizeof(struct s));
+ printf("sizeof(struct s)=%zd\en", sizeof(struct s));
exit(EXIT_SUCCESS);
}
.I s
is not NULL and
.I *s
-is not a null byte (\(aq\\0\(aq)), the argument string
+is not a null byte (\(aq\e0\(aq)), the argument string
.I s
is printed, followed by a colon and a blank.
Then an error message corresponding to the current value of
#include <wait.h>
#include <errno.h>
-#define errExit(msg) do { perror(msg); \\
+#define errExit(msg) do { perror(msg); \e
exit(EXIT_FAILURE); } while (0)
-#define errExitEN(en, msg) \\
- do { errno = en; perror(msg); \\
+#define errExitEN(en, msg) \e
+ do { errno = en; perror(msg); \e
exit(EXIT_FAILURE); } while (0)
char **environ;
errExitEN(s, "posix_spawn_file_actions_destroy");
}
- printf("PID of child: %ld\\n", (long) child_pid);
+ printf("PID of child: %ld\en", (long) child_pid);
/* Monitor status of the child until it terminates */
printf("Child status: ");
if (WIFEXITED(status)) {
- printf("exited, status=%d\\n", WEXITSTATUS(status));
+ printf("exited, status=%d\en", WEXITSTATUS(status));
} else if (WIFSIGNALED(status)) {
- printf("killed by signal %d\\n", WTERMSIG(status));
+ printf("killed by signal %d\en", WTERMSIG(status));
} else if (WIFSTOPPED(status)) {
- printf("stopped by signal %d\\n", WSTOPSIG(status));
+ printf("stopped by signal %d\en", WSTOPSIG(status));
} else if (WIFCONTINUED(status)) {
- printf("continued\\n");
+ printf("continued\en");
}
} while (!WIFEXITED(status) && !WIFSIGNALED(status));
argument is expected to be a pointer to an array of character type (pointer
to a string).
Characters from the array are written up to (but not
-including) a terminating null byte (\(aq\\0\(aq);
+including) a terminating null byte (\(aq\e0\(aq);
if a precision is specified, no more than the number specified
are written.
If a precision is given, no null byte need be present;
if (size < 0)
return NULL;
- size++; /* For '\\0' */
+ size++; /* For '\e0' */
p = malloc(size);
if (p == NULL)
return NULL;
#include <unistd.h>
#include <errno.h>
-#define handle_error_en(en, msg) \\
+#define handle_error_en(en, msg) \e
do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)
static void
s = pthread_attr_getdetachstate(attr, &i);
if (s != 0)
handle_error_en(s, "pthread_attr_getdetachstate");
- printf("%sDetach state = %s\\n", prefix,
+ printf("%sDetach state = %s\en", prefix,
(i == PTHREAD_CREATE_DETACHED) ? "PTHREAD_CREATE_DETACHED" :
(i == PTHREAD_CREATE_JOINABLE) ? "PTHREAD_CREATE_JOINABLE" :
"???");
s = pthread_attr_getscope(attr, &i);
if (s != 0)
handle_error_en(s, "pthread_attr_getscope");
- printf("%sScope = %s\\n", prefix,
+ printf("%sScope = %s\en", prefix,
(i == PTHREAD_SCOPE_SYSTEM) ? "PTHREAD_SCOPE_SYSTEM" :
(i == PTHREAD_SCOPE_PROCESS) ? "PTHREAD_SCOPE_PROCESS" :
"???");
s = pthread_attr_getinheritsched(attr, &i);
if (s != 0)
handle_error_en(s, "pthread_attr_getinheritsched");
- printf("%sInherit scheduler = %s\\n", prefix,
+ printf("%sInherit scheduler = %s\en", prefix,
(i == PTHREAD_INHERIT_SCHED) ? "PTHREAD_INHERIT_SCHED" :
(i == PTHREAD_EXPLICIT_SCHED) ? "PTHREAD_EXPLICIT_SCHED" :
"???");
s = pthread_attr_getschedpolicy(attr, &i);
if (s != 0)
handle_error_en(s, "pthread_attr_getschedpolicy");
- printf("%sScheduling policy = %s\\n", prefix,
+ printf("%sScheduling policy = %s\en", prefix,
(i == SCHED_OTHER) ? "SCHED_OTHER" :
(i == SCHED_FIFO) ? "SCHED_FIFO" :
(i == SCHED_RR) ? "SCHED_RR" :
s = pthread_attr_getschedparam(attr, &sp);
if (s != 0)
handle_error_en(s, "pthread_attr_getschedparam");
- printf("%sScheduling priority = %d\\n", prefix, sp.sched_priority);
+ printf("%sScheduling priority = %d\en", prefix, sp.sched_priority);
s = pthread_attr_getguardsize(attr, &v);
if (s != 0)
handle_error_en(s, "pthread_attr_getguardsize");
- printf("%sGuard size = %zu bytes\\n", prefix, v);
+ printf("%sGuard size = %zu bytes\en", prefix, v);
s = pthread_attr_getstack(attr, &stkaddr, &v);
if (s != 0)
handle_error_en(s, "pthread_attr_getstack");
- printf("%sStack address = %p\\n", prefix, stkaddr);
- printf("%sStack size = 0x%zx bytes\\n", prefix, v);
+ printf("%sStack address = %p\en", prefix, stkaddr);
+ printf("%sStack size = 0x%zx bytes\en", prefix, v);
}
static void *
if (s != 0)
handle_error_en(s, "pthread_getattr_np");
- printf("Thread attributes:\\n");
- display_pthread_attr(&gattr, "\\t");
+ printf("Thread attributes:\en");
+ display_pthread_attr(&gattr, "\et");
exit(EXIT_SUCCESS); /* Terminate all threads */
}
if (s != 0)
handle_error_en(s, "posix_memalign");
- printf("posix_memalign() allocated at %p\\n", sp);
+ printf("posix_memalign() allocated at %p\en", sp);
s = pthread_attr_setstack(&attr, sp, stack_size);
if (s != 0)
#include <stdlib.h>
#include <unistd.h>
-#define handle_error_en(en, msg) \\
+#define handle_error_en(en, msg) \e
do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)
static void *
if (s != 0)
handle_error_en(s, "pthread_setcancelstate");
- printf("thread_func(): started; cancellation disabled\\n");
+ printf("thread_func(): started; cancellation disabled\en");
sleep(5);
- printf("thread_func(): about to enable cancellation\\n");
+ printf("thread_func(): about to enable cancellation\en");
s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
if (s != 0)
/* Should never get here */
- printf("thread_func(): not canceled!\\n");
+ printf("thread_func(): not canceled!\en");
return NULL;
}
sleep(2); /* Give thread a chance to get started */
- printf("main(): sending cancellation request\\n");
+ printf("main(): sending cancellation request\en");
s = pthread_cancel(thr);
if (s != 0)
handle_error_en(s, "pthread_cancel");
handle_error_en(s, "pthread_join");
if (res == PTHREAD_CANCELED)
- printf("main(): thread was canceled\\n");
+ printf("main(): thread was canceled\en");
else
- printf("main(): thread wasn\(aqt canceled (shouldn\(aqt happen!)\\n");
+ printf("main(): thread wasn\(aqt canceled (shouldn\(aqt happen!)\en");
exit(EXIT_SUCCESS);
}
.EE
#include <unistd.h>
#include <errno.h>
-#define handle_error_en(en, msg) \\
+#define handle_error_en(en, msg) \e
do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)
static int done = 0;
static void
cleanup_handler(void *arg)
{
- printf("Called clean\-up handler\\n");
+ printf("Called clean\-up handler\en");
cnt = 0;
}
{
time_t start, curr;
- printf("New thread started\\n");
+ printf("New thread started\en");
pthread_cleanup_push(cleanup_handler, NULL);
pthread_testcancel(); /* A cancellation point */
if (curr < time(NULL)) {
curr = time(NULL);
- printf("cnt = %d\\n", cnt); /* A cancellation point */
+ printf("cnt = %d\en", cnt); /* A cancellation point */
cnt++;
}
}
done = 1;
} else {
- printf("Canceling thread\\n");
+ printf("Canceling thread\en");
s = pthread_cancel(thr);
if (s != 0)
handle_error_en(s, "pthread_cancel");
handle_error_en(s, "pthread_join");
if (res == PTHREAD_CANCELED)
- printf("Thread was canceled; cnt = %d\\n", cnt);
+ printf("Thread was canceled; cnt = %d\en", cnt);
else
- printf("Thread terminated normally; cnt = %d\\n", cnt);
+ printf("Thread terminated normally; cnt = %d\en", cnt);
exit(EXIT_SUCCESS);
}
.EE
#include <errno.h>
#include <ctype.h>
-#define handle_error_en(en, msg) \\
+#define handle_error_en(en, msg) \e
do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)
-#define handle_error(msg) \\
+#define handle_error(msg) \e
do { perror(msg); exit(EXIT_FAILURE); } while (0)
struct thread_info { /* Used as argument to thread_start() */
struct thread_info *tinfo = arg;
char *uargv, *p;
- printf("Thread %d: top of stack near %p; argv_string=%s\\n",
+ printf("Thread %d: top of stack near %p; argv_string=%s\en",
tinfo\->thread_num, &p, tinfo\->argv_string);
uargv = strdup(tinfo\->argv_string);
if (uargv == NULL)
handle_error("strdup");
- for (p = uargv; *p != \(aq\\0\(aq; p++)
+ for (p = uargv; *p != \(aq\e0\(aq; p++)
*p = toupper(*p);
return uargv;
break;
default:
- fprintf(stderr, "Usage: %s [\-s stack-size] arg...\\n",
+ fprintf(stderr, "Usage: %s [\-s stack-size] arg...\en",
argv[0]);
exit(EXIT_FAILURE);
}
if (s != 0)
handle_error_en(s, "pthread_join");
- printf("Joined with thread %d; returned value was %s\\n",
+ printf("Joined with thread %d; returned value was %s\en",
tinfo[tnum].thread_num, (char *) res);
free(res); /* Free memory allocated by thread */
}
#include <stdlib.h>
#include <errno.h>
-#define errExitEN(en, msg) \\
- do { errno = en; perror(msg); \\
+#define errExitEN(en, msg) \e
+ do { errno = en; perror(msg); \e
exit(EXIT_FAILURE); } while (0)
static void
s = pthread_attr_getstacksize(attr, &stacksize);
if (s != 0)
errExitEN(s, "pthread_attr_getstacksize");
- printf("Stack size: %zd\\n", stacksize);
+ printf("Stack size: %zd\en", stacksize);
s = pthread_attr_getguardsize(attr, &guardsize);
if (s != 0)
errExitEN(s, "pthread_attr_getguardsize");
- printf("Guard size: %zd\\n", guardsize);
+ printf("Guard size: %zd\en", guardsize);
s = pthread_attr_getschedpolicy(attr, &policy);
if (s != 0)
errExitEN(s, "pthread_attr_getschedpolicy");
- printf("Scheduling policy: %s\\n",
+ printf("Scheduling policy: %s\en",
(policy == SCHED_FIFO) ? "SCHED_FIFO" :
(policy == SCHED_RR) ? "SCHED_RR" :
(policy == SCHED_OTHER) ? "SCHED_OTHER" : "[unknown]");
s = pthread_attr_getschedparam(attr, &schedparam);
if (s != 0)
errExitEN(s, "pthread_attr_getschedparam");
- printf("Scheduling priority: %d\\n", schedparam.sched_priority);
+ printf("Scheduling priority: %d\en", schedparam.sched_priority);
s = pthread_attr_getdetachstate(attr, &detachstate);
if (s != 0)
errExitEN(s, "pthread_attr_getdetachstate");
- printf("Detach state: %s\\n",
+ printf("Detach state: %s\en",
(detachstate == PTHREAD_CREATE_DETACHED) ? "DETACHED" :
(detachstate == PTHREAD_CREATE_JOINABLE) ? "JOINABLE" :
"???");
s = pthread_attr_getinheritsched(attr, &inheritsched);
if (s != 0)
errExitEN(s, "pthread_attr_getinheritsched");
- printf("Inherit scheduler: %s\\n",
+ printf("Inherit scheduler: %s\en",
(inheritsched == PTHREAD_INHERIT_SCHED) ? "INHERIT" :
(inheritsched == PTHREAD_EXPLICIT_SCHED) ? "EXPLICIT" :
"???");
#include <unistd.h>
#include <errno.h>
-#define handle_error_en(en, msg) \\
+#define handle_error_en(en, msg) \e
do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)
static void
s = pthread_attr_getguardsize(attr, &guard_size);
if (s != 0)
handle_error_en(s, "pthread_attr_getguardsize");
- printf("%sGuard size = %d bytes\\n", prefix, guard_size);
+ printf("%sGuard size = %d bytes\en", prefix, guard_size);
s = pthread_attr_getstack(attr, &stack_addr, &stack_size);
if (s != 0)
printf("%sStack address = %p", prefix, stack_addr);
if (stack_size > 0)
printf(" (EOS = %p)", (char *) stack_addr + stack_size);
- printf("\\n");
- printf("%sStack size = 0x%x (%d) bytes\\n",
+ printf("\en");
+ printf("%sStack size = 0x%x (%d) bytes\en",
prefix, stack_size, stack_size);
}
static void * /* Start function for thread we create */
thread_start(void *arg)
{
- printf("Attributes of created thread:\\n");
- display_thread_attributes(pthread_self(), "\\t");
+ printf("Attributes of created thread:\en");
+ display_thread_attributes(pthread_self(), "\et");
exit(EXIT_SUCCESS); /* Terminate all threads */
}
if (msg != NULL)
fputs(msg, stderr);
fprintf(stderr, "Usage: %s [\-s stack\-size [\-a]]"
- " [\-g guard\-size]\\n", pname);
- fprintf(stderr, "\\t\\t\-a means program should allocate stack\\n");
+ " [\-g guard\-size]\en", pname);
+ fprintf(stderr, "\et\et\-a means program should allocate stack\en");
exit(EXIT_FAILURE);
}
}
if (allocate_stack && stack_size == \-1)
- usage(argv[0], "Specifying \-a without \-s makes no sense\\n");
+ usage(argv[0], "Specifying \-a without \-s makes no sense\en");
if (argc > optind)
- usage(argv[0], "Extraneous command\-line arguments\\n");
+ usage(argv[0], "Extraneous command\-line arguments\en");
if (stack_size >= 0 || guard_size > 0) {
ret_attrp = attrp;
stack_size);
if (s != 0)
handle_error_en(s, "posix_memalign");
- printf("Allocated thread stack at %p\\n\\n", stack_addr);
+ printf("Allocated thread stack at %p\en\en", stack_addr);
s = pthread_attr_setstack(attrp, stack_addr, stack_size);
if (s != 0)
attrp = get_thread_attributes_from_cl(argc, argv, &attr);
if (attrp != NULL) {
- printf("Thread attributes object after initializations:\\n");
- display_stack_related_attributes(attrp, "\\t");
- printf("\\n");
+ printf("Thread attributes object after initializations:\en");
+ display_stack_related_attributes(attrp, "\et");
+ printf("\en");
}
s = pthread_create(&thr, attrp, &thread_start, NULL);
#include <string.h>
#include <errno.h>
-#define handle_error(msg) \\
+#define handle_error(msg) \e
do { perror(msg); exit(EXIT_FAILURE); } while (0)
-#define handle_error_en(en, msg) \\
+#define handle_error_en(en, msg) \e
do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)
static void *
thread_start(void *arg)
{
- printf("Subthread starting infinite loop\\n");
+ printf("Subthread starting infinite loop\en");
for (;;)
continue;
}
printf("%s", msg);
if (clock_gettime(cid, &ts) == \-1)
handle_error("clock_gettime");
- printf("%4ld.%03ld\\n", ts.tv_sec, ts.tv_nsec / 1000000);
+ printf("%4ld.%03ld\en", ts.tv_sec, ts.tv_nsec / 1000000);
}
int
if (s != 0)
handle_error_en(s, "pthread_create");
- printf("Main thread sleeping\\n");
+ printf("Main thread sleeping\en");
sleep(1);
- printf("Main thread consuming some CPU time...\\n");
+ printf("Main thread consuming some CPU time...\en");
for (j = 0; j < 2000000; j++)
getppid();
#include <pthread.h>
#include <errno.h>
-#define handle_error_en(en, msg) \\
+#define handle_error_en(en, msg) \e
do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)
static pthread_mutex_t mtx;
static void *
original_owner_thread(void *ptr)
{
- printf("[original owner] Setting lock...\\n");
+ printf("[original owner] Setting lock...\en");
pthread_mutex_lock(&mtx);
- printf("[original owner] Locked. Now exiting without unlocking.\\n");
+ printf("[original owner] Locked. Now exiting without unlocking.\en");
pthread_exit(NULL);
}
/* "original_owner_thread" should have exited by now */
- printf("[main thread] Attempting to lock the robust mutex.\\n");
+ printf("[main thread] Attempting to lock the robust mutex.\en");
s = pthread_mutex_lock(&mtx);
if (s == EOWNERDEAD) {
- printf("[main thread] pthread_mutex_lock() returned EOWNERDEAD\\n");
- printf("[main thread] Now make the mutex consistent\\n");
+ printf("[main thread] pthread_mutex_lock() returned EOWNERDEAD\en");
+ printf("[main thread] Now make the mutex consistent\en");
s = pthread_mutex_consistent(&mtx);
if (s != 0)
handle_error_en(s, "pthread_mutex_consistent");
- printf("[main thread] Mutex is now consistent; unlocking\\n");
+ printf("[main thread] Mutex is now consistent; unlocking\en");
s = pthread_mutex_unlock(&mtx);
if (s != 0)
handle_error_en(s, "pthread_mutex_unlock");
exit(EXIT_SUCCESS);
} else if (s == 0) {
- printf("[main thread] pthread_mutex_lock() unexpectedly succeeded\\n");
+ printf("[main thread] pthread_mutex_lock() unexpectedly succeeded\en");
exit(EXIT_FAILURE);
} else {
- printf("[main thread] pthread_mutex_lock() unexpectedly failed\\n");
+ printf("[main thread] pthread_mutex_lock() unexpectedly failed\en");
handle_error_en(s, "pthread_mutex_lock");
}
}
#include <stdlib.h>
#include <errno.h>
-#define handle_error_en(en, msg) \\
+#define handle_error_en(en, msg) \e
do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)
int
if (s != 0)
handle_error_en(s, "pthread_getaffinity_np");
- printf("Set returned by pthread_getaffinity_np() contained:\\n");
+ printf("Set returned by pthread_getaffinity_np() contained:\en");
for (j = 0; j < CPU_SETSIZE; j++)
if (CPU_ISSET(j, &cpuset))
- printf(" CPU %d\\n", j);
+ printf(" CPU %d\en", j);
exit(EXIT_SUCCESS);
}
which can be useful for debugging
multithreaded applications.
The thread name is a meaningful C language string, whose length is
-restricted to 16 characters, including the terminating null byte (\(aq\\0\(aq).
+restricted to 16 characters, including the terminating null byte (\(aq\e0\(aq).
The
.I thread
argument specifies the thread whose name is to be changed;
#define NAMELEN 16
-#define errExitEN(en, msg) \\
- do { errno = en; perror(msg); exit(EXIT_FAILURE); \\
+#define errExitEN(en, msg) \e
+ do { errno = en; perror(msg); exit(EXIT_FAILURE); \e
} while (0)
static void *
if (rc != 0)
errExitEN(rc, "pthread_getname_np");
- printf("Created a thread. Default name is: %s\\n", thread_name);
+ printf("Created a thread. Default name is: %s\en", thread_name);
rc = pthread_setname_np(thread, (argc > 1) ? argv[1] : "THREADFOO");
if (rc != 0)
errExitEN(rc, "pthread_setname_np");
(argc > 2) ? atoi(argv[1]) : NAMELEN);
if (rc != 0)
errExitEN(rc, "pthread_getname_np");
- printf("The thread name after setting it is %s.\\n", thread_name);
+ printf("The thread name after setting it is %s.\en", thread_name);
rc = pthread_join(thread, NULL);
if (rc != 0)
errExitEN(rc, "pthread_join");
- printf("Done\\n");
+ printf("Done\en");
exit(EXIT_SUCCESS);
}
.EE
#include <unistd.h>
#include <errno.h>
-#define handle_error_en(en, msg) \\
+#define handle_error_en(en, msg) \e
do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)
static void
if (msg != NULL)
fputs(msg, stderr);
- fprintf(stderr, "Usage: %s [options]\\n", prog_name);
- fprintf(stderr, "Options are:\\n");
-#define fpe(msg) fprintf(stderr, "\\t%s", msg); /* Shorter */
- fpe("\-a<policy><prio> Set scheduling policy and priority in\\n");
- fpe(" thread attributes object\\n");
- fpe(" <policy> can be\\n");
- fpe(" f SCHED_FIFO\\n");
- fpe(" r SCHED_RR\\n");
- fpe(" o SCHED_OTHER\\n");
- fpe("\-A Use default thread attributes object\\n");
- fpe("\-i {e|i} Set inherit scheduler attribute to\\n");
- fpe(" \(aqexplicit\(aq or \(aqinherit\(aq\\n");
- fpe("\-m<policy><prio> Set scheduling policy and priority on\\n");
- fpe(" main thread before pthread_create() call\\n");
+ fprintf(stderr, "Usage: %s [options]\en", prog_name);
+ fprintf(stderr, "Options are:\en");
+#define fpe(msg) fprintf(stderr, "\et%s", msg); /* Shorter */
+ fpe("\-a<policy><prio> Set scheduling policy and priority in\en");
+ fpe(" thread attributes object\en");
+ fpe(" <policy> can be\en");
+ fpe(" f SCHED_FIFO\en");
+ fpe(" r SCHED_RR\en");
+ fpe(" o SCHED_OTHER\en");
+ fpe("\-A Use default thread attributes object\en");
+ fpe("\-i {e|i} Set inherit scheduler attribute to\en");
+ fpe(" \(aqexplicit\(aq or \(aqinherit\(aq\en");
+ fpe("\-m<policy><prio> Set scheduling policy and priority on\en");
+ fpe(" main thread before pthread_create() call\en");
exit(EXIT_FAILURE);
}
static void
display_sched_attr(int policy, struct sched_param *param)
{
- printf(" policy=%s, priority=%d\\n",
+ printf(" policy=%s, priority=%d\en",
(policy == SCHED_FIFO) ? "SCHED_FIFO" :
(policy == SCHED_RR) ? "SCHED_RR" :
(policy == SCHED_OTHER) ? "SCHED_OTHER" :
if (s != 0)
handle_error_en(s, "pthread_getschedparam");
- printf("%s\\n", msg);
+ printf("%s\en", msg);
display_sched_attr(policy, ¶m);
}
case \(aqA\(aq: use_null_attrib = 1; break;
case \(aqi\(aq: inheritsched_str = optarg; break;
case \(aqm\(aq: main_sched_str = optarg; break;
- default: usage(argv[0], "Unrecognized option\\n");
+ default: usage(argv[0], "Unrecognized option\en");
}
}
if (use_null_attrib &&
(inheritsched_str != NULL || attr_sched_str != NULL))
- usage(argv[0], "Can\(aqt specify \-A with \-i or \-a\\n");
+ usage(argv[0], "Can\(aqt specify \-A with \-i or \-a\en");
/* Optionally set scheduling attributes of main thread,
and display the attributes */
if (main_sched_str != NULL) {
if (!get_policy(main_sched_str[0], &policy))
- usage(argv[0], "Bad policy for main thread (\-m)\\n");
+ usage(argv[0], "Bad policy for main thread (\-m)\en");
param.sched_priority = strtol(&main_sched_str[1], NULL, 0);
s = pthread_setschedparam(pthread_self(), policy, ¶m);
}
display_thread_sched_attr("Scheduler settings of main thread");
- printf("\\n");
+ printf("\en");
/* Initialize thread attributes object according to options */
else if (inheritsched_str[0] == \(aqi\(aq)
inheritsched = PTHREAD_INHERIT_SCHED;
else
- usage(argv[0], "Value for \-i must be \(aqe\(aq or \(aqi\(aq\\n");
+ usage(argv[0], "Value for \-i must be \(aqe\(aq or \(aqi\(aq\en");
s = pthread_attr_setinheritsched(&attr, inheritsched);
if (s != 0)
if (attr_sched_str != NULL) {
if (!get_policy(attr_sched_str[0], &policy))
usage(argv[0],
- "Bad policy for \(aqattr\(aq (\-a)\\n");
+ "Bad policy for \(aqattr\(aq (\-a)\en");
param.sched_priority = strtol(&attr_sched_str[1], NULL, 0);
s = pthread_attr_setschedpolicy(&attr, policy);
if (s != 0)
handle_error_en(s, "pthread_attr_getschedpolicy");
- printf("Scheduler settings in \(aqattr\(aq\\n");
+ printf("Scheduler settings in \(aqattr\(aq\en");
display_sched_attr(policy, ¶m);
s = pthread_attr_getinheritsched(&attr, &inheritsched);
- printf(" inheritsched is %s\\n",
+ printf(" inheritsched is %s\en",
(inheritsched == PTHREAD_INHERIT_SCHED) ? "INHERIT" :
(inheritsched == PTHREAD_EXPLICIT_SCHED) ? "EXPLICIT" :
"???");
- printf("\\n");
+ printf("\en");
}
/* Create a thread that will display its scheduling attributes */
/* Simple error handling functions */
-#define handle_error_en(en, msg) \\
+#define handle_error_en(en, msg) \e
do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)
static void *
s = sigwait(set, &sig);
if (s != 0)
handle_error_en(s, "sigwait");
- printf("Signal handling thread got signal %d\\n", sig);
+ printf("Signal handling thread got signal %d\en", sig);
}
}
int j;
if (argc < 2) {
- fprintf(stderr, "Usage: %s <string>...\\n", argv[0]);
+ fprintf(stderr, "Usage: %s <string>...\en", argv[0]);
exit(EXIT_FAILURE);
}
unsigned int seed;
if (argc != 3) {
- fprintf(stderr, "Usage: %s <seed> <nloops>\\n", argv[0]);
+ fprintf(stderr, "Usage: %s <seed> <nloops>\en", argv[0]);
exit(EXIT_FAILURE);
}
srand(seed);
for (j = 0; j < nloops; j++) {
r = rand();
- printf("%d\\n", r);
+ printf("%d\en", r);
}
exit(EXIT_SUCCESS);
.IR "char\ d_name[]",
a character array of unspecified size, with at most
.B NAME_MAX
-characters preceding the terminating null byte (\(aq\\0\(aq).
+characters preceding the terminating null byte (\(aq\e0\(aq).
.PP
POSIX.1 explicitly notes that this field should not be used as an lvalue.
The standard also notes that the use of
.I errbuf
is filled in with the first
.I "errbuf_size \- 1"
-characters of the error message and a terminating null byte (\(aq\\0\(aq).
+characters of the error message and a terminating null byte (\(aq\e0\(aq).
.SS POSIX pattern buffer freeing
Supplying
.BR regfree ()
main(int argc, char *argv[])
{
if (argc != 2 || strcmp(argv[1], "\-\-help") == 0) {
- fprintf(stderr, "%s response\\n", argv[0]);
+ fprintf(stderr, "%s response\en", argv[0]);
exit(EXIT_FAILURE);
}
setlocale(LC_ALL, "");
- printf("rpmatch() returns: %d\\n", rpmatch(argv[1]));
+ printf("rpmatch() returns: %d\en", rpmatch(argv[1]));
exit(EXIT_SUCCESS);
}
.EE
perror("rtime error");
else {
time_t t = time1.tv_sec;
- printf("%s\\n", ctime(&t));
+ printf("%s\en", ctime(&t));
}
exit(EXIT_SUCCESS);
Most conversions discard initial white space characters (the exceptions
are noted below),
and these discarded characters don't count toward the maximum field width.
-String input conversions store a terminating null byte (\(aq\\0\(aq)
+String input conversions store a terminating null byte (\(aq\e0\(aq)
to mark the end of the input;
the maximum field width does not include this terminator.
.TP
Matches a sequence of non-white-space characters;
the next pointer must be a pointer to the initial element of a
character array that is long enough to hold the input sequence and
-the terminating null byte (\(aq\\0\(aq), which is added automatically.
+the terminating null byte (\(aq\e0\(aq), which is added automatically.
The input string stops at white space or at the maximum field
width, whichever occurs first.
.TP
errno = 0;
n = scanf("%m[a\-z]", &p);
if (n == 1) {
- printf("read: %s\\n", p);
+ printf("read: %s\en", p);
free(p);
} else if (errno != 0) {
perror("scanf");
} else {
- fprintf(stderr, "No matching characters\\n");
+ fprintf(stderr, "No matching characters\en");
}
.EE
.in
sem_t sem;
-#define handle_error(msg) \\
+#define handle_error(msg) \e
do { perror(msg); exit(EXIT_FAILURE); } while (0)
static void
handler(int sig)
{
- write(STDOUT_FILENO, "sem_post() from handler\\n", 24);
+ write(STDOUT_FILENO, "sem_post() from handler\en", 24);
if (sem_post(&sem) == \-1) {
- write(STDERR_FILENO, "sem_post() failed\\n", 18);
+ write(STDERR_FILENO, "sem_post() failed\en", 18);
_exit(EXIT_FAILURE);
}
}
int s;
if (argc != 3) {
- fprintf(stderr, "Usage: %s <alarm\-secs> <wait\-secs>\\n",
+ fprintf(stderr, "Usage: %s <alarm\-secs> <wait\-secs>\en",
argv[0]);
exit(EXIT_FAILURE);
}
ts.tv_sec += atoi(argv[2]);
- printf("main() about to call sem_timedwait()\\n");
+ printf("main() about to call sem_timedwait()\en");
while ((s = sem_timedwait(&sem, &ts)) == \-1 && errno == EINTR)
continue; /* Restart if interrupted by handler */
if (s == \-1) {
if (errno == ETIMEDOUT)
- printf("sem_timedwait() timed out\\n");
+ printf("sem_timedwait() timed out\en");
else
perror("sem_timedwait");
} else
- printf("sem_timedwait() succeeded\\n");
+ printf("sem_timedwait() succeeded\en");
exit((s == 0) ? EXIT_SUCCESS : EXIT_FAILURE);
}
al = getaliasent();
if (al == NULL)
break;
- printf("Name: %s\\n", al\->alias_name);
+ printf("Name: %s\en", al\->alias_name);
}
if (errno) {
perror("reading alias");
{
char buf[BUFSIZ];
setbuf(stdin, buf);
- printf("Hello, world!\\n");
+ printf("Hello, world!\en");
return 0;
}
.EE
.BR stpcpy ()
function copies the string pointed to by
.I src
-(including the terminating null byte (\(aq\\0\(aq)) to the array pointed to by
+(including the terminating null byte (\(aq\e0\(aq)) to the array pointed to by
.IR dest .
The strings may not overlap, and the destination string
.I dest
to = stpcpy(to, "foo");
to = stpcpy(to, "bar");
- printf("%s\\n", buffer);
+ printf("%s\en", buffer);
}
.EE
.SH SEE ALSO
characters from the string
pointed to by
.IR src ,
-including the terminating null byte (\(aq\\0\(aq),
+including the terminating null byte (\(aq\e0\(aq),
to the array pointed to by
.IR dest .
Exactly
remaining characters in the array pointed to by
.I dest
are filled
-with null bytes (\(aq\\0\(aq),
+with null bytes (\(aq\e0\(aq),
If the length
.I strlen(src)
is greater than or equal to
string to the
.I dest
string,
-overwriting the terminating null byte (\(aq\\0\(aq) at the end of
+overwriting the terminating null byte (\(aq\e0\(aq) at the end of
.IR dest ,
and then adds a terminating null byte.
The strings may not overlap, and the
size_t dest_len = strlen(dest);
size_t i;
- for (i = 0 ; i < n && src[i] != \(aq\\0\(aq ; i++)
+ for (i = 0 ; i < n && src[i] != \(aq\e0\(aq ; i++)
dest[dest_len + i] = src[i];
- dest[dest_len + i] = \(aq\\0\(aq;
+ dest[dest_len + i] = \(aq\e0\(aq;
return dest;
}
time_t base;
base = time(NULL);
- p[0] = \(aq\\0\(aq;
+ p[0] = \(aq\e0\(aq;
for (j = 0; j < LIM; j++) {
if ((j % 10000) == 0)
- printf("%d %ld\\n", j, (long) (time(NULL) \- base));
+ printf("%d %ld\en", j, (long) (time(NULL) \- base));
strcat(p, "a");
}
}
The terminating null byte is considered part of the string,
so that if
.I c
-is specified as \(aq\\0\(aq,
+is specified as \(aq\e0\(aq,
these functions return a pointer to the terminator.
.PP
The
.BR strcpy ()
function copies the string pointed to by
.IR src ,
-including the terminating null byte (\(aq\\0\(aq),
+including the terminating null byte (\(aq\e0\(aq),
to the buffer pointed to by
.IR dest .
The strings may not overlap, and the destination string
{
size_t i;
- for (i = 0; i < n && src[i] != \(aq\\0\(aq; i++)
+ for (i = 0; i < n && src[i] != \(aq\e0\(aq; i++)
dest[i] = src[i];
for ( ; i < n; i++)
- dest[i] = \(aq\\0\(aq;
+ dest[i] = \(aq\e0\(aq;
return dest;
}
.EX
if (buflen > 0) {
strncpy(buf, str, buflen \- 1);
- buf[buflen \- 1]= \(aq\\0\(aq;
+ buf[buflen \- 1]= \(aq\e0\(aq;
}
.EE
.in
.IR n ,
only
.I n
-bytes are copied, and a terminating null byte (\(aq\\0\(aq) is added.
+bytes are copied, and a terminating null byte (\(aq\e0\(aq) is added.
.PP
.BR strdupa ()
and
is too small and
.I errnum
is unknown).
-The string always includes a terminating null byte (\(aq\\0\(aq).
+The string always includes a terminating null byte (\(aq\e0\(aq).
.\"
.SS strerror_l()
.BR strerror_l ()
characters are stored into
.IR str .
.PP
-The terminating null character ('\\0') is written if and only if
+The terminating null character ('\e0') is written if and only if
.I n
is sufficiently large, otherwise the written string is truncated at
.I n
exit(EXIT_FAILURE);
}
- printf("Result string is \\"%s\\"\\n", outstr);
+ printf("Result string is \e"%s\e"\en", outstr);
exit(EXIT_SUCCESS);
}
.EE
.BR strlen ()
function calculates the length of the string pointed to by
.IR s ,
-excluding the terminating null byte (\(aq\\0\(aq).
+excluding the terminating null byte (\(aq\e0\(aq).
.SH RETURN VALUE
The
.BR strlen ()
function returns the number of bytes in the string
pointed to by
.IR s ,
-excluding the terminating null byte (\(aq\\0\(aq),
+excluding the terminating null byte (\(aq\e0\(aq),
but at most
.IR maxlen .
In doing this,
.IR maxlen ,
or
.I maxlen
-if there is no null terminating (\(aq\\0\(aq) among the first
+if there is no null terminating (\(aq\e0\(aq) among the first
.I maxlen
characters pointed to by
.IR s .
that is delimited by one of the bytes in the string
.IR delim .
This token is terminated by overwriting the delimiter
-with a null byte (\(aq\\0\(aq),
+with a null byte (\(aq\e0\(aq),
and
.I *stringp
is updated to point past the token.
.I needle
in the string
.IR haystack .
-The terminating null bytes (\(aq\\0\(aq) are not compared.
+The terminating null bytes (\(aq\e0\(aq) are not compared.
.PP
The
.BR strcasestr ()
.PP
The end of each token is found by scanning forward until either
the next delimiter byte is found or until the
-terminating null byte (\(aq\\0\(aq) is encountered.
+terminating null byte (\(aq\e0\(aq) is encountered.
If a delimiter byte is found, it is overwritten with
a null byte to terminate the current token, and
.BR strtok ()
int j;
if (argc != 4) {
- fprintf(stderr, "Usage: %s string delim subdelim\\n",
+ fprintf(stderr, "Usage: %s string delim subdelim\en",
argv[0]);
exit(EXIT_FAILURE);
}
token = strtok_r(str1, argv[2], &saveptr1);
if (token == NULL)
break;
- printf("%d: %s\\n", j, token);
+ printf("%d: %s\en", j, token);
for (str2 = token; ; str2 = NULL) {
subtoken = strtok_r(str2, argv[3], &saveptr2);
if (subtoken == NULL)
break;
- printf("\t \-\-> %s\\n", subtoken);
+ printf("\t \-\-> %s\en", subtoken);
}
}
(and returns 0).
In particular, if
.I *nptr
-is not \(aq\\0\(aq but
+is not \(aq\e0\(aq but
.I **endptr
-is \(aq\\0\(aq on return, the entire string is valid.
+is \(aq\e0\(aq on return, the entire string is valid.
.PP
The
.BR strtoll ()
long val;
if (argc < 2) {
- fprintf(stderr, "Usage: %s str [base]\\n", argv[0]);
+ fprintf(stderr, "Usage: %s str [base]\en", argv[0]);
exit(EXIT_FAILURE);
}
}
if (endptr == str) {
- fprintf(stderr, "No digits were found\\n");
+ fprintf(stderr, "No digits were found\en");
exit(EXIT_FAILURE);
}
/* If we got here, strtol() successfully parsed a number */
- printf("strtol() returned %ld\\n", val);
+ printf("strtol() returned %ld\en", val);
- if (*endptr != \(aq\\0\(aq) /* Not necessarily an error... */
- printf("Further characters after number: %s\\n", endptr);
+ if (*endptr != \(aq\e0\(aq) /* Not necessarily an error... */
+ printf("Further characters after number: %s\en", endptr);
exit(EXIT_SUCCESS);
}
(and returns 0).
In particular, if
.I *nptr
-is not \(aq\\0\(aq but
+is not \(aq\e0\(aq but
.I **endptr
-is \(aq\\0\(aq on return, the entire string is valid.
+is \(aq\e0\(aq on return, the entire string is valid.
.PP
The
.BR strtoull ()
int res;
if (argc != 3) {
- fprintf(stderr, "Usage: %s <string1> <string2>\\n", argv[0]);
+ fprintf(stderr, "Usage: %s <string1> <string2>\en", argv[0]);
exit(EXIT_FAILURE);
}
res = strverscmp(argv[1], argv[2]);
- printf("%s %s %s\\n", argv[1],
+ printf("%s %s %s\en", argv[1],
(res < 0) ? "<" : (res == 0) ? "==" : ">", argv[2]);
exit(EXIT_SUCCESS);
store the transformed string in
.I dest
excluding the
-terminating null byte (\(aq\\0\(aq).
+terminating null byte (\(aq\e0\(aq).
If the value returned is
.I n
or more, the
terminal of a foreground process group, it will cause a
\fBSIGINT\fP to be sent to this foreground process group.
When neither \fBIGNBRK\fP nor \fBBRKINT\fP are set, a BREAK
-reads as a null byte (\(aq\\0\(aq), except when \fBPARMRK\fP is set,
-in which case it reads as the sequence \\377 \\0 \\0.
+reads as a null byte (\(aq\e0\(aq), except when \fBPARMRK\fP is set,
+in which case it reads as the sequence \e377 \e0 \e0.
.TP
.B IGNPAR
Ignore framing errors and parity errors.
This bit is meaningful only when
\fBINPCK\fP is set and \fBIGNPAR\fP is not set.
The way erroneous bytes are marked is with two preceding bytes,
-\\377 and \\0.
+\e377 and \e0.
Thus, the program actually reads three bytes for one
erroneous byte received from the terminal.
-If a valid byte has the value \\377,
+If a valid byte has the value \e377,
and \fBISTRIP\fP (see below) is not set,
the program might confuse it with the prefix that marks a
parity error.
-Therefore, a valid byte \\377 is passed to the program as two
-bytes, \\377 \\377, in this case.
+Therefore, a valid byte \e377 is passed to the program as two
+bytes, \e377 \e377, in this case.
.IP
If neither \fBIGNPAR\fP nor \fBPARMRK\fP
is set, read a character with a parity error or framing error
-as \\0.
+as \e0.
.TP
.B INPCK
Enable input parity checking.
.TP
.B OFDEL
Fill character is ASCII DEL (0177).
-If unset, fill character is ASCII NUL (\(aq\\0\(aq).
+If unset, fill character is ASCII NUL (\(aq\e0\(aq).
(Not implemented on Linux.)
.TP
.B NLDLY
.B XCASE
(not in POSIX; not supported under Linux)
If \fBICANON\fP is also set, terminal is uppercase only.
-Input is converted to lowercase, except for characters preceded by \\.
-On output, uppercase characters are preceded by \\ and lowercase
+Input is converted to lowercase, except for characters preceded by \e.
+On output, uppercase characters are preceded by \e and lowercase
characters are converted to uppercase.
[requires
.B _BSD_SOURCE
p = malloc(n);
if (p)
return p;
- fprintf(stderr, "insufficient memory\\n");
+ fprintf(stderr, "insufficient memory\en");
exit(EXIT_FAILURE);
}
break;
case postorder:
datap = *(int **) nodep;
- printf("%6d\\n", *datap);
+ printf("%6d\en", *datap);
break;
case endorder:
break;
case leaf:
datap = *(int **) nodep;
- printf("%6d\\n", *datap);
+ printf("%6d\en", *datap);
break;
}
}
function.
It copies the wide-character string pointed to by
.IR src ,
-including the terminating null wide character (L\(aq\\0\(aq),
+including the terminating null wide character (L\(aq\e0\(aq),
to the array pointed to by
.IR dest .
.PP
wide characters from the wide-character
string pointed to by
.IR src ,
-including the terminating null wide (L\(aq\\0\(aq),
+including the terminating null wide (L\(aq\e0\(aq),
to the array pointed to by
.IR dest .
Exactly
the remaining wide characters in the array pointed to
by
.I dest
-are filled with L\(aq\\0\(aq characters.
+are filled with L\(aq\e0\(aq characters.
If the length
.IR wcslen(src)
is greater than or equal
the string pointed to by
.I dest
will
-not be L\(aq\\0\(aq terminated.
+not be L\(aq\e0\(aq terminated.
.PP
The strings may not overlap.
.PP
is
not NULL and
.I wc
-is not a null wide character (L\(aq\\0\(aq).
+is not a null wide character (L\(aq\e0\(aq).
In this case, the
.BR wcrtomb ()
function
is not NULL,
but
.I wc
-is a null wide character (L\(aq\\0\(aq).
+is a null wide character (L\(aq\e0\(aq).
In this case, the
.BR wcrtomb ()
function stores at
bring
.I *ps
back to the initial state,
-followed by a \(aq\\0\(aq byte.
+followed by a \(aq\e0\(aq byte.
It updates the shift state
.I *ps
(i.e., brings
is ignored,
and the function effectively returns
.PP
- wcrtomb(buf, L\(aq\\0\(aq, ps)
+ wcrtomb(buf, L\(aq\e0\(aq, ps)
.PP
where
.I buf
function.
It copies the wide-character string pointed to by
.IR src ,
-including the terminating null wide character (L\(aq\\0\(aq),
+including the terminating null wide character (L\(aq\e0\(aq),
to the end of the wide-character string pointed to by
.IR dest .
.PP
function.
It copies the wide-character string pointed to by
.IR src ,
-including the terminating null wide character (L\(aq\\0\(aq),
+including the terminating null wide character (L\(aq\e0\(aq),
to the array pointed to by
.IR dest .
.PP
It determines the length of the wide-character string pointed to
by
.IR s ,
-excluding the terminating null wide character (L\(aq\\0\(aq).
+excluding the terminating null wide character (L\(aq\e0\(aq).
.SH RETURN VALUE
The
.BR wcslen ()
to the end of the wide-character string pointed
to by
.IR dest ,
-and adds a terminating null wide character (L\(aq\\0\(aq).
+and adds a terminating null wide character (L\(aq\e0\(aq).
.PP
The strings may not overlap.
.PP
wide
characters from each string.
In each string, the comparison extends only up
-to the first occurrence of a null wide character (L\(aq\\0\(aq), if any.
+to the first occurrence of a null wide character (L\(aq\e0\(aq), if any.
.SH RETURN VALUE
The
.BR wcsncmp ()
wide characters from the wide-character
string pointed to by
.IR src ,
-including the terminating null wide character (L\(aq\\0\(aq),
+including the terminating null wide character (L\(aq\e0\(aq),
to the array pointed to by
.IR dest .
Exactly
function.
It returns the number of wide-characters in the string pointed to by
.IR s ,
-not including the terminating null wide character (L\(aq\\0\(aq),
+not including the terminating null wide character (L\(aq\e0\(aq),
but at most
.I maxlen
wide characters (note: this parameter is not a byte count).
.IP 2.
.I nwc
wide characters have been
-converted without encountering a null wide character (L\(aq\\0\(aq),
+converted without encountering a null wide character (L\(aq\e0\(aq),
or the length limit forces a stop.
In this case,
.I *src
is set to NULL, and the number
of bytes written to
.IR dest ,
-excluding the terminating null byte (\(aq\\0\(aq), is
+excluding the terminating null byte (\(aq\e0\(aq), is
returned.
.PP
If
is returned.
.IP 3.
The wide-character string has been completely converted, including the
-terminating null wide character (L\(aq\\0\(aq),
+terminating null wide character (L\(aq\e0\(aq),
which has the side effect of bringing back
.I *ps
to the initial state.
is set to NULL, and the number
of bytes written to
.IR dest ,
-excluding the terminating null byte (\(aq\\0\(aq),
+excluding the terminating null byte (\(aq\e0\(aq),
is returned.
.PP
If
function.
It searches for the first occurrence of the wide-character string
.I needle
-(without its terminating null wide character (L\(aq\\0\(aq))
+(without its terminating null wide character (L\(aq\e0\(aq))
as a substring in the wide-character string
.IR haystack .
.SH RETURN VALUE
token by replacing the next wide-character which occurs in
.I delim
with
-a null wide character (L\(aq\\0\(aq),
+a null wide character (L\(aq\e0\(aq),
and it updates
.I *ptr
so that subsequent calls will
wchar_t *wcs = ...;
wchar_t *token;
wchar_t *state;
-for (token = wcstok(wcs, " \\t\\n", &state);
+for (token = wcstok(wcs, " \et\en", &state);
token != NULL;
- token = wcstok(NULL, " \\t\\n", &state)) {
+ token = wcstok(NULL, " \et\en", &state)) {
...
}
.EE
is returned, but the shift state at this point is lost.
.IP 3.
The wide-character string has been completely converted, including the
-terminating null wide character (L\(aq\\0\(aq).
+terminating null wide character (L\(aq\e0\(aq).
In this case, the conversion ends in the initial shift state.
The number of bytes written to
.IR dest ,
-excluding the terminating null byte (\(aq\\0\(aq), is returned.
+excluding the terminating null byte (\(aq\e0\(aq), is returned.
.PP
The programmer must ensure that there is room for at least
.I n
is at least 0.
If
.I c
-is null wide character (L\(aq\\0\(aq), the value is 0.
+is null wide character (L\(aq\e0\(aq), the value is 0.
Otherwise, \-1 is returned.
.SH RETURN VALUE
The
function with a conversion state starting in the initial state before
the first byte).
The resulting wide characters are written up to
-(but not including) the terminating null wide character (L\(aq\\0\(aq).
+(but not including) the terminating null wide character (L\(aq\e0\(aq).
If a precision is
specified, no more wide characters than the number specified are written.
Note that the precision determines the number of
.I bytes
or
.IR "screen positions" .
-The array must contain a terminating null byte (\(aq\\0\(aq),
+The array must contain a terminating null byte (\(aq\e0\(aq),
unless a precision is given
and it is so small that the number of converted wide characters reaches it
before the end of the array is reached.
wide characters using their Unicode (ISO-10646) code point, but other
platforms don't do this.
Also, the use of C99 universal character names
-of the form \\unnnn does not solve this problem.)
+of the form \eunnnn does not solve this problem.)
Therefore, in
internationalized programs, the
.I format
.BR reset (1)
that just does "echo ^[c".
If your terminfo entry for the console is correct
-(and has an entry rs1=\\Ec), then "tput reset" will also work.
+(and has an entry rs1=\eEc), then "tput reset" will also work.
.PP
The user-defined mapping table can be set using
.BR mapscrn (8).
character only.)
ESC O SS3 Single shift 3. (Select G3 character set for the next
character only.)
-ESC P DCS Device control string (ended by ESC \\)
+ESC P DCS Device control string (ended by ESC \e)
ESC X SOS Start of string.
-ESC ^ PM Privacy message (ended by ESC \\)
-ESC \\ ST String terminator
+ESC ^ PM Privacy message (ended by ESC \e)
+ESC \e ST String terminator
ESC * ... Designate G2 character set
ESC + ... Designate G3 character set
.TE
The program
.BR xterm (1)
(in VT100 mode) recognizes ESC c, ESC # 8, ESC >, ESC =,
-ESC D, ESC E, ESC H, ESC M, ESC N, ESC O, ESC P ... ESC \\,
+ESC D, ESC E, ESC H, ESC M, ESC N, ESC O, ESC P ... ESC \e,
ESC Z (it answers ESC [ ? 1 ; 2 c, "I am a VT100 with
advanced video option")
-and ESC ^ ... ESC \\ with the same meanings as indicated above.
+and ESC ^ ... ESC \e with the same meanings as indicated above.
It accepts ESC (, ESC ), ESC *, ESC + followed by 0, A, B for
the DEC special character and line drawing set, UK, and US-ASCII,
respectively.
and is the number of bytes that will be received at a time from the
DSP56001.
These data quantities will either truncated, or padded with
-a null byte (\(aq\\0\(aq) to fit the native 24-bit data format of the DSP56001.
+a null byte (\(aq\e0\(aq) to fit the native 24-bit data format of the DSP56001.
.IP \fBDSP56K_HOST_FLAGS\fP
read and write the host flags.
The host flags are four
.PP
Reads from the
.I /dev/full
-device will return \\0 characters.
+device will return \e0 characters.
.PP
Seeks on
.I /dev/full
.in +4n
.EX
echo /var/nfsroot >/proc/sys/kernel/nfs-root-name
-echo 193.8.232.2:193.8.232.7::255.255.255.0:idefix \\
+echo 193.8.232.2:193.8.232.7::255.255.255.0:idefix \e
>/proc/sys/kernel/nfs-root-addrs
echo 255 >/proc/sys/kernel/real-root-dev
.EE
#include <stdlib.h>
#include <unistd.h>
-#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\
+#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e
} while (0)
int
char loopname[4096];
if (argc != 2) {
- fprintf(stderr, "Usage: %s backing\-file\\n", argv[0]);
+ fprintf(stderr, "Usage: %s backing\-file\en", argv[0]);
exit(EXIT_FAILURE);
}
errExit("ioctl\-LOOP_CTL_GET_FREE");
sprintf(loopname, "/dev/loop%ld", devnr);
- printf("loopname = %s\\n", loopname);
+ printf("loopname = %s\en", loopname);
loopfd = open(loopname, O_RDWR);
if (loopfd == \-1)
if (s & mask)
ch |= 0x100;
attrib = ((s & ~mask) >> 8);
- printf("ch=0x%03x attrib=0x%02x\\n", ch, attrib);
+ printf("ch=0x%03x attrib=0x%02x\en", ch, attrib);
s ^= 0x1000;
(void) lseek(fd, \-2, SEEK_CUR);
(void) write(fd, &s, 2);
is followed by a character that should be used as the escape character
for the rest of the file to mark characters that should be interpreted
in a special way.
-It defaults to the backslash (\\).
+It defaults to the backslash (\e).
.TP
.RI < mb_cur_max >
is followed by the maximum number of bytes for a character.
/* Display command\-line arguments given to core_pattern
pipe program */
- fprintf(fp, "argc=%d\\n", argc);
+ fprintf(fp, "argc=%d\en", argc);
for (j = 0; j < argc; j++)
- fprintf(fp, "argc[%d]=<%s>\\n", j, argv[j]);
+ fprintf(fp, "argc[%d]=<%s>\en", j, argv[j]);
/* Count bytes in standard input (the core dump) */
tot = 0;
while ((nread = read(STDIN_FILENO, buf, BUF_SIZE)) > 0)
tot += nread;
- fprintf(fp, "Total bytes in core dump: %d\\n", tot);
+ fprintf(fp, "Total bytes in core dump: %d\en", tot);
fclose(fp);
exit(EXIT_SUCCESS);
One references a string as an index into the string
table section.
The first byte, which is index zero, is defined to hold
-a null byte (\(aq\\0\(aq).
+a null byte (\(aq\e0\(aq).
Similarly, a string table's last byte is defined to
hold a null byte, ensuring null termination for all strings.
.PP
is followed by a character that should be used as the
escape-character for the rest of the file to mark characters that
should be interpreted in a special way.
-It defaults to the backslash (\\).
+It defaults to the backslash (\e).
.TP
.I comment_char
is followed by a character that will be used as the
In the latter case, there is nothing in this file:
that is, a read on this file will return 0 characters.
The command-line arguments appear in this file as a set of
-strings separated by null bytes (\(aq\\0\(aq),
+strings separated by null bytes (\(aq\e0\(aq),
with a further null byte after the last string.
.TP
.IR /proc/[pid]/comm " (since Linux 2.6.33)"
This file contains the initial environment that was set
when the currently executing program was started via
.BR execve (2).
-The entries are separated by null bytes (\(aq\\0\(aq),
+The entries are separated by null bytes (\(aq\e0\(aq),
and there may be a null byte at the end.
Thus, to print out the environment of process 1, you would do:
.IP
with an octal escape sequence.
As a result, it is not possible to determine whether the original
pathname contained a newline character or the literal
-.I \\\012
+.I \ee012
character sequence.
.IP
If the mapping is file-backed and the file has been deleted, the string
.BR sysctl (2)
system call.
.IP
-String values may be terminated by either \(aq\\0\(aq or \(aq\\n\(aq.
+String values may be terminated by either \(aq\e0\(aq or \(aq\en\(aq.
.IP
Integer and long values may be written either in decimal or in
hexadecimal notation (e.g. 0x3FFF).
When writing multiple integer or long values, these may be separated
by any of the following whitespace characters:
-\(aq\ \(aq, \(aq\\t\(aq, or \(aq\\n\(aq.
+\(aq\ \(aq, \(aq\et\(aq, or \(aq\en\(aq.
Using other separators leads to the error
.BR EINVAL .
.TP
.SH NOTES
Many files contain strings (e.g., the environment and command line)
that are in the internal format,
-with subfields terminated by null bytes (\(aq\\0\(aq).
+with subfields terminated by null bytes (\(aq\e0\(aq).
When inspecting such files, you may find that the results are more readable
if you use a command of the following form to display them:
.PP
is followed by a character that should be used as the escape character
for the rest of the file to mark characters that should be interpreted
in a special way.
-It defaults to the backslash (\\).
+It defaults to the backslash (\e).
.PP
The mapping section starts with the keyword
.I CHARIDS
.EX
$ \fBstat \-c "%t %T" /dev/null\fP
1 3
-$ \fBreadlink /sys/dev/char/1\\:3\fP
+$ \fBreadlink /sys/dev/char/1\e:3\fP
\&../../devices/virtual/mem/null
$ \fBls \-Fd /sys/devices/virtual/mem/null\fP
/sys/devices/virtual/mem/null/
.B TERM
environment variable.
.PP
-Termcap entries must be defined on a single logical line, with \(aq\\\(aq
+Termcap entries must be defined on a single logical line, with \(aq\e\(aq
used to suppress the newline.
Fields are separated by \(aq:\(aq.
The first field of each entry starts at the left-hand margin,
.IP %
Print a \(aq%\(aq
.PP
-If you use binary output, then you should avoid the null character (\(aq\\0\(aq)
+If you use binary output, then you should avoid the null character (\(aq\e0\(aq)
because it terminates the string.
You should reset tabulator expansion
if a tabulator can be the binary output of a parameter.
.PP
The
.B SIGQUIT
-signal (generated by typing control-\\) causes the program to request
+signal (generated by typing control-\e) causes the program to request
cancellation of each of the outstanding requests using
.BR aio_cancel (3).
.PP
aioSigHandler(int sig, siginfo_t *si, void *ucontext)
{
if (si->si_code == SI_ASYNCIO) {
- write(STDOUT_FILENO, "I/O completion signal received\\n", 31);
+ write(STDOUT_FILENO, "I/O completion signal received\en", 31);
/* The corresponding ioRequest structure would be available as
struct ioRequest *ioReq = si\->si_value.sival_ptr;
int openReqs; /* Number of I/O requests still in progress */
if (argc < 2) {
- fprintf(stderr, "Usage: %s <pathname> <pathname>...\\n",
+ fprintf(stderr, "Usage: %s <pathname> <pathname>...\en",
argv[0]);
exit(EXIT_FAILURE);
}
ioList[j].aiocbp\->aio_fildes = open(argv[j + 1], O_RDONLY);
if (ioList[j].aiocbp\->aio_fildes == \-1)
errExit("open");
- printf("opened %s on descriptor %d\\n", argv[j + 1],
+ printf("opened %s on descriptor %d\en", argv[j + 1],
ioList[j].aiocbp\->aio_fildes);
ioList[j].aiocbp\->aio_buf = malloc(BUF_SIZE);
outstanding I/O requests, and display status returned
from the cancellation requests */
- printf("got SIGQUIT; canceling I/O requests: \\n");
+ printf("got SIGQUIT; canceling I/O requests: \en");
for (j = 0; j < numReqs; j++) {
if (ioList[j].status == EINPROGRESS) {
s = aio_cancel(ioList[j].aiocbp\->aio_fildes,
ioList[j].aiocbp);
if (s == AIO_CANCELED)
- printf("I/O canceled\\n");
+ printf("I/O canceled\en");
else if (s == AIO_NOTCANCELED)
- printf("I/O not canceled\\n");
+ printf("I/O not canceled\en");
else if (s == AIO_ALLDONE)
- printf("I/O all done\\n");
+ printf("I/O all done\en");
else
errMsg("aio_cancel");
}
/* Check the status of each I/O request that is still
in progress */
- printf("aio_error():\\n");
+ printf("aio_error():\en");
for (j = 0; j < numReqs; j++) {
if (ioList[j].status == EINPROGRESS) {
printf(" for request %d (descriptor %d): ",
switch (ioList[j].status) {
case 0:
- printf("I/O succeeded\\n");
+ printf("I/O succeeded\en");
break;
case EINPROGRESS:
- printf("In progress\\n");
+ printf("In progress\en");
break;
case ECANCELED:
- printf("Canceled\\n");
+ printf("Canceled\en");
break;
default:
errMsg("aio_error");
}
}
- printf("All I/O requests completed\\n");
+ printf("All I/O requests completed\en");
/* Check status return of all I/O requests */
- printf("aio_return():\\n");
+ printf("aio_return():\en");
for (j = 0; j < numReqs; j++) {
ssize_t s;
s = aio_return(ioList[j].aiocbp);
- printf(" for request %d (descriptor %d): %zd\\n",
+ printf(" for request %d (descriptor %d): %zd\en",
j, ioList[j].aiocbp\->aio_fildes, s);
}
.PP
.in +4n
.EX
-mount -t cgroup2 -o remount,nsdelegate \\
+mount -t cgroup2 -o remount,nsdelegate \e
none /sys/fs/cgroup/unified
.EE
.in
Note that the only way ASCII bytes occur
in a UTF-8 stream, is as themselves.
In particular, there are no
-embedded NULs (\(aq\\0\(aq) or \(aq/\(aqs that form part of some larger code.
+embedded NULs (\(aq\e0\(aq) or \(aq/\(aqs that form part of some larger code.
.PP
Since ASCII, and, in particular, NUL and \(aq/\(aq, are unchanged, the
kernel does not notice that UTF-8 is being used.
{
double pi = 4 * atan(1.0);
double complex z = cexp(I * pi);
- printf("%f + %f * i\\n", creal(z), cimag(z));
+ printf("%f + %f * i\en", creal(z), cimag(z));
}
.EE
.SH SEE ALSO
if (metadata\->vers != FANOTIFY_METADATA_VERSION) {
fprintf(stderr,
- "Mismatch of fanotify metadata version.\\n");
+ "Mismatch of fanotify metadata version.\en");
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}
- path[path_len] = '\\0';
- printf("File %s\\n", path);
+ path[path_len] = '\e0';
+ printf("File %s\en", path);
/* Close the file descriptor of the event */
/* Check mount point is supplied */
if (argc != 2) {
- fprintf(stderr, "Usage: %s MOUNT\\n", argv[0]);
+ fprintf(stderr, "Usage: %s MOUNT\en", argv[0]);
exit(EXIT_FAILURE);
}
- printf("Press enter key to terminate.\\n");
+ printf("Press enter key to terminate.\en");
/* Create the file descriptor for accessing the fanotify API */
/* This is the loop to wait for incoming events */
- printf("Listening for events.\\n");
+ printf("Listening for events.\en");
while (1) {
poll_num = poll(fds, nfds, \-1);
/* Console input is available: empty stdin and quit */
- while (read(STDIN_FILENO, &buf, 1) > 0 && buf != '\\n')
+ while (read(STDIN_FILENO, &buf, 1) > 0 && buf != '\en')
continue;
break;
}
}
}
- printf("Listening for events stopped.\\n");
+ printf("Listening for events stopped.\en");
exit(EXIT_SUCCESS);
}
.EE
main(int argc, char *argv[])
{
#ifdef _POSIX_SOURCE
- printf("_POSIX_SOURCE defined\\n");
+ printf("_POSIX_SOURCE defined\en");
#endif
#ifdef _POSIX_C_SOURCE
- printf("_POSIX_C_SOURCE defined: %ldL\\n", (long) _POSIX_C_SOURCE);
+ printf("_POSIX_C_SOURCE defined: %ldL\en", (long) _POSIX_C_SOURCE);
#endif
#ifdef _ISOC99_SOURCE
- printf("_ISOC99_SOURCE defined\\n");
+ printf("_ISOC99_SOURCE defined\en");
#endif
#ifdef _ISOC11_SOURCE
- printf("_ISOC11_SOURCE defined\\n");
+ printf("_ISOC11_SOURCE defined\en");
#endif
#ifdef _XOPEN_SOURCE
- printf("_XOPEN_SOURCE defined: %d\\n", _XOPEN_SOURCE);
+ printf("_XOPEN_SOURCE defined: %d\en", _XOPEN_SOURCE);
#endif
#ifdef _XOPEN_SOURCE_EXTENDED
- printf("_XOPEN_SOURCE_EXTENDED defined\\n");
+ printf("_XOPEN_SOURCE_EXTENDED defined\en");
#endif
#ifdef _LARGEFILE64_SOURCE
- printf("_LARGEFILE64_SOURCE defined\\n");
+ printf("_LARGEFILE64_SOURCE defined\en");
#endif
#ifdef _FILE_OFFSET_BITS
- printf("_FILE_OFFSET_BITS defined: %d\\n", _FILE_OFFSET_BITS);
+ printf("_FILE_OFFSET_BITS defined: %d\en", _FILE_OFFSET_BITS);
#endif
#ifdef _BSD_SOURCE
- printf("_BSD_SOURCE defined\\n");
+ printf("_BSD_SOURCE defined\en");
#endif
#ifdef _SVID_SOURCE
- printf("_SVID_SOURCE defined\\n");
+ printf("_SVID_SOURCE defined\en");
#endif
#ifdef _DEFAULT_SOURCE
- printf("_DEFAULT_SOURCE defined\\n");
+ printf("_DEFAULT_SOURCE defined\en");
#endif
#ifdef _ATFILE_SOURCE
- printf("_ATFILE_SOURCE defined\\n");
+ printf("_ATFILE_SOURCE defined\en");
#endif
#ifdef _GNU_SOURCE
- printf("_GNU_SOURCE defined\\n");
+ printf("_GNU_SOURCE defined\en");
#endif
#ifdef _REENTRANT
- printf("_REENTRANT defined\\n");
+ printf("_REENTRANT defined\en");
#endif
#ifdef _THREAD_SAFE
- printf("_THREAD_SAFE defined\\n");
+ printf("_THREAD_SAFE defined\en");
#endif
#ifdef _FORTIFY_SOURCE
- printf("_FORTIFY_SOURCE defined\\n");
+ printf("_FORTIFY_SOURCE defined\en");
#endif
exit(EXIT_SUCCESS);
for a file inside a watched directory;
it identifies the filename within to the watched directory.
This filename is null-terminated,
-and may include further null bytes (\(aq\\0\(aq) to align subsequent reads to a
+and may include further null bytes (\(aq\e0\(aq) to align subsequent reads to a
suitable address boundary.
.PP
The
/* Print type of filesystem object */
if (event\->mask & IN_ISDIR)
- printf(" [directory]\\n");
+ printf(" [directory]\en");
else
- printf(" [file]\\n");
+ printf(" [file]\en");
}
}
}
struct pollfd fds[2];
if (argc < 2) {
- printf("Usage: %s PATH [PATH ...]\\n", argv[0]);
+ printf("Usage: %s PATH [PATH ...]\en", argv[0]);
exit(EXIT_FAILURE);
}
- printf("Press ENTER key to terminate.\\n");
+ printf("Press ENTER key to terminate.\en");
/* Create the file descriptor for accessing the inotify API */
wd[i] = inotify_add_watch(fd, argv[i],
IN_OPEN | IN_CLOSE);
if (wd[i] == \-1) {
- fprintf(stderr, "Cannot watch '%s'\\n", argv[i]);
+ fprintf(stderr, "Cannot watch '%s'\en", argv[i]);
perror("inotify_add_watch");
exit(EXIT_FAILURE);
}
/* Wait for events and/or terminal input */
- printf("Listening for events.\\n");
+ printf("Listening for events.\en");
while (1) {
poll_num = poll(fds, nfds, \-1);
if (poll_num == \-1) {
/* Console input is available. Empty stdin and quit */
- while (read(STDIN_FILENO, &buf, 1) > 0 && buf != '\\n')
+ while (read(STDIN_FILENO, &buf, 1) > 0 && buf != '\en')
continue;
break;
}
}
}
- printf("Listening for events stopped.\\n");
+ printf("Listening for events stopped.\en");
/* Close inotify file descriptor */
char *int_curr_symbol; /* First three chars are a currency
symbol from ISO 4217. Fourth char
is the separator. Fifth char
- is \(aq\\0\(aq. */
+ is \(aq\e0\(aq. */
char *currency_symbol; /* Local currency symbol */
char *mon_decimal_point; /* Radix character */
char *mon_thousands_sep; /* Like \fIthousands_sep\fP above */
for important details of the line(s) that should follow the
\fB.SH NAME\fP command.
All words in this line (including the word immediately
-following the "\\\-") should be in lowercase,
+following the "\e\-") should be in lowercase,
except where English or technical terminological convention
dictates otherwise.
.TP
(don't hyphenate)
directives.
Hyphenation of individual page names can be prevented
-by preceding words with the string "\\%".
+by preceding words with the string "\e%".
.IP
Given the distributed, autonomous nature of FOSS projects
and their documentation, it is sometimes necessary\(emand in many cases
.BR fcntl ()
.EE
.PP
-(Using this format, rather than the use of "\\fB...\\fP()"
+(Using this format, rather than the use of "\efB...\efP()"
makes it easier to write tools that parse man page source files.)
.\"
.SS Formatting conventions (general)
In addition, "e.g." and "i.e." should always be followed by a comma.
.SS Em-dashes
The way to write an em-dash\(emthe glyph that appears
-at either end of this subphrase\(emin *roff is with the macro "\\(em".
+at either end of this subphrase\(emin *roff is with the macro "\e(em".
(On an ASCII terminal, an em-dash typically renders as two hyphens,
but in other typographical contexts it renders as a long dash.)
Em-dashes should be written
.IR "ls\ \-l"),
use the following form in the man page source:
.PP
- \\\-
+ \e\-
.PP
This guideline applies also to code examples.
.SS Character constants
To produce single quotes that render well in both ASCII and UTF-8,
use the following form for character constants in the man page source:
.PP
- \\(aqC\\(aq
+ \e(aqC\e(aq
.PP
where
.I C
.BR man-pages (7).
.SS Title line
The first command in a man page (after comment lines,
-that is, lines that start with \fB.\\"\fP) should be
+that is, lines that start with \fB.\e"\fP) should be
.PP
.RS
.B \&.TH
.RS
\&.SH NAME
.br
-item \\- description
+item \e- description
.RE
.PP
It is extremely important that this format is followed, and that there is a
unsigned int ecx = 0;
unsigned int edx = 0;
- asm volatile(".byte 0x0f,0x01,0xef\\n\\t"
+ asm volatile(".byte 0x0f,0x01,0xef\en\et"
: : "a" (eax), "c" (ecx), "d" (edx));
}
return syscall(SYS_pkey_free, pkey);
}
-#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\
+#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e
} while (0)
int
* Put some random data into the page (still OK to touch)
*/
*buffer = __LINE__;
- printf("buffer contains: %d\\n", *buffer);
+ printf("buffer contains: %d\en", *buffer);
/*
* Allocate a protection key:
if (status == -1)
errExit("pkey_mprotect");
- printf("about to read buffer again...\\n");
+ printf("about to read buffer again...\en");
/*
* This will crash, because we have disallowed access
*/
- printf("buffer contains: %d\\n", *buffer);
+ printf("buffer contains: %d\en", *buffer);
status = pkey_free(pkey);
if (status == -1)
.PP
.in +4n
.EX
-bash$ $( ldd /bin/ls | grep libc.so | awk \(aq{print $3}\(aq ) | \\
+bash$ $( ldd /bin/ls | grep libc.so | awk \(aq{print $3}\(aq ) | \e
egrep \-i \(aqthreads|nptl\(aq
Native POSIX Threads Library by Ulrich Drepper et al
.EE
.PP
.in +4n
.EX
-bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\
+bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \e
awk \(aq{print $3}\(aq ) | egrep \-i \(aqthreads|nptl\(aq
linuxthreads-0.10 by Xavier Leroy
.EE
unsigned int
la_version(unsigned int version)
{
- printf("la_version(): %d\\n", version);
+ printf("la_version(): %d\en", version);
return version;
}
la_objsearch(const char *name, uintptr_t *cookie, unsigned int flag)
{
printf("la_objsearch(): name = %s; cookie = %p", name, cookie);
- printf("; flag = %s\\n",
+ printf("; flag = %s\en",
(flag == LA_SER_ORIG) ? "LA_SER_ORIG" :
(flag == LA_SER_LIBPATH) ? "LA_SER_LIBPATH" :
(flag == LA_SER_RUNPATH) ? "LA_SER_RUNPATH" :
void
la_activity (uintptr_t *cookie, unsigned int flag)
{
- printf("la_activity(): cookie = %p; flag = %s\\n", cookie,
+ printf("la_activity(): cookie = %p; flag = %s\en", cookie,
(flag == LA_ACT_CONSISTENT) ? "LA_ACT_CONSISTENT" :
(flag == LA_ACT_ADD) ? "LA_ACT_ADD" :
(flag == LA_ACT_DELETE) ? "LA_ACT_DELETE" :
unsigned int
la_objopen(struct link_map *map, Lmid_t lmid, uintptr_t *cookie)
{
- printf("la_objopen(): loading \\"%s\\"; lmid = %s; cookie=%p\\n",
+ printf("la_objopen(): loading \e"%s\e"; lmid = %s; cookie=%p\en",
map\->l_name,
(lmid == LM_ID_BASE) ? "LM_ID_BASE" :
(lmid == LM_ID_NEWLM) ? "LM_ID_NEWLM" :
unsigned int
la_objclose (uintptr_t *cookie)
{
- printf("la_objclose(): %p\\n", cookie);
+ printf("la_objclose(): %p\en", cookie);
return 0;
}
void
la_preinit(uintptr_t *cookie)
{
- printf("la_preinit(): %p\\n", cookie);
+ printf("la_preinit(): %p\en", cookie);
}
uintptr_t
la_symbind32(Elf32_Sym *sym, unsigned int ndx, uintptr_t *refcook,
uintptr_t *defcook, unsigned int *flags, const char *symname)
{
- printf("la_symbind32(): symname = %s; sym\->st_value = %p\\n",
+ printf("la_symbind32(): symname = %s; sym\->st_value = %p\en",
symname, sym\->st_value);
printf(" ndx = %d; flags = 0x%x", ndx, *flags);
- printf("; refcook = %p; defcook = %p\\n", refcook, defcook);
+ printf("; refcook = %p; defcook = %p\en", refcook, defcook);
return sym\->st_value;
}
la_symbind64(Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
uintptr_t *defcook, unsigned int *flags, const char *symname)
{
- printf("la_symbind64(): symname = %s; sym\->st_value = %p\\n",
+ printf("la_symbind64(): symname = %s; sym\->st_value = %p\en",
symname, sym\->st_value);
printf(" ndx = %d; flags = 0x%x", ndx, *flags);
- printf("; refcook = %p; defcook = %p\\n", refcook, defcook);
+ printf("; refcook = %p; defcook = %p\en", refcook, defcook);
return sym\->st_value;
}
uintptr_t *refcook, uintptr_t *defcook, La_i86_regs *regs,
unsigned int *flags, const char *symname, long int *framesizep)
{
- printf("la_i86_gnu_pltenter(): %s (%p)\\n", symname, sym\->st_value);
+ printf("la_i86_gnu_pltenter(): %s (%p)\en", symname, sym\->st_value);
return sym\->st_value;
}
print_diag(const struct unix_diag_msg *diag, unsigned int len)
{
if (len < NLMSG_LENGTH(sizeof(*diag))) {
- fputs("short response\\n", stderr);
+ fputs("short response\en", stderr);
return \-1;
}
if (diag\->udiag_family != AF_UNIX) {
- fprintf(stderr, "unexpected family %u\\n", diag\->udiag_family);
+ fprintf(stderr, "unexpected family %u\en", diag\->udiag_family);
return \-1;
}
if (path_len > sizeof(path) \- 1)
path_len = sizeof(path) \- 1;
memcpy(path, RTA_DATA(attr), path_len);
- path[path_len] = '\\0';
+ path[path_len] = '\e0';
}
break;
printf(", name=%s%s", *path ? "" : "@",
*path ? path : path + 1);
- putchar('\\n');
+ putchar('\en');
return 0;
}
const struct nlmsghdr *h = (struct nlmsghdr *) buf;
if (!NLMSG_OK(h, ret)) {
- fputs("!NLMSG_OK\\n", stderr);
+ fputs("!NLMSG_OK\en", stderr);
return \-1;
}
const struct nlmsgerr *err = NLMSG_DATA(h);
if (h\->nlmsg_len < NLMSG_LENGTH(sizeof(*err))) {
- fputs("NLMSG_ERROR\\n", stderr);
+ fputs("NLMSG_ERROR\en", stderr);
} else {
errno = \-err\->error;
perror("NLMSG_ERROR");
}
if (h\->nlmsg_type != SOCK_DIAG_BY_FAMILY) {
- fprintf(stderr, "unexpected nlmsg_type %u\\n",
+ fprintf(stderr, "unexpected nlmsg_type %u\en",
(unsigned) h\->nlmsg_type);
return \-1;
}
an abstract socket address is distinguished (from a pathname socket)
by the fact that
.IR sun_path[0]
-is a null byte (\(aq\\0\(aq).
+is a null byte (\(aq\e0\(aq).
The socket's address in this namespace is given by the additional
bytes in
.IR sun_path
if (getsockname(sfd, (struct sockaddr *) addrp, &addrlen)) == \-1)
/* handle error */ ;
-printf("sun_path = %s\\n", ((struct sockaddr_un *) addrp)\->sun_path);
+printf("sun_path = %s\en", ((struct sockaddr_un *) addrp)\->sun_path);
.EE
.in
.PP
ret = connect (data_socket, (const struct sockaddr *) &addr,
sizeof(struct sockaddr_un));
if (ret == \-1) {
- fprintf(stderr, "The server is down.\\n");
+ fprintf(stderr, "The server is down.\en");
exit(EXIT_FAILURE);
}
buffer[BUFFER_SIZE \- 1] = 0;
- printf("Result = %s\\n", buffer);
+ printf("Result = %s\en", buffer);
/* Close socket. */
/* A simple error\-handling function: print an error message based
on the value in \(aqerrno\(aq and terminate the calling process */
-#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\
+#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e
} while (0)
struct child_args {
static void
usage(char *pname)
{
- fprintf(stderr, "Usage: %s [options] cmd [arg...]\\n\\n", pname);
+ fprintf(stderr, "Usage: %s [options] cmd [arg...]\en\en", pname);
fprintf(stderr, "Create a child process that executes a shell "
- "command in a new user namespace,\\n"
- "and possibly also other new namespace(s).\\n\\n");
- fprintf(stderr, "Options can be:\\n\\n");
+ "command in a new user namespace,\en"
+ "and possibly also other new namespace(s).\en\en");
+ fprintf(stderr, "Options can be:\en\en");
#define fpe(str) fprintf(stderr, " %s", str);
- fpe("\-i New IPC namespace\\n");
- fpe("\-m New mount namespace\\n");
- fpe("\-n New network namespace\\n");
- fpe("\-p New PID namespace\\n");
- fpe("\-u New UTS namespace\\n");
- fpe("\-U New user namespace\\n");
- fpe("\-M uid_map Specify UID map for user namespace\\n");
- fpe("\-G gid_map Specify GID map for user namespace\\n");
- fpe("\-z Map user\(aqs UID and GID to 0 in user namespace\\n");
- fpe(" (equivalent to: \-M \(aq0 <uid> 1\(aq \-G \(aq0 <gid> 1\(aq)\\n");
- fpe("\-v Display verbose messages\\n");
- fpe("\\n");
- fpe("If \-z, \-M, or \-G is specified, \-U is required.\\n");
- fpe("It is not permitted to specify both \-z and either \-M or \-G.\\n");
- fpe("\\n");
- fpe("Map strings for \-M and \-G consist of records of the form:\\n");
- fpe("\\n");
- fpe(" ID\-inside\-ns ID\-outside\-ns len\\n");
- fpe("\\n");
+ fpe("\-i New IPC namespace\en");
+ fpe("\-m New mount namespace\en");
+ fpe("\-n New network namespace\en");
+ fpe("\-p New PID namespace\en");
+ fpe("\-u New UTS namespace\en");
+ fpe("\-U New user namespace\en");
+ fpe("\-M uid_map Specify UID map for user namespace\en");
+ fpe("\-G gid_map Specify GID map for user namespace\en");
+ fpe("\-z Map user\(aqs UID and GID to 0 in user namespace\en");
+ fpe(" (equivalent to: \-M \(aq0 <uid> 1\(aq \-G \(aq0 <gid> 1\(aq)\en");
+ fpe("\-v Display verbose messages\en");
+ fpe("\en");
+ fpe("If \-z, \-M, or \-G is specified, \-U is required.\en");
+ fpe("It is not permitted to specify both \-z and either \-M or \-G.\en");
+ fpe("\en");
+ fpe("Map strings for \-M and \-G consist of records of the form:\en");
+ fpe("\en");
+ fpe(" ID\-inside\-ns ID\-outside\-ns len\en");
+ fpe("\en");
fpe("A map string can contain multiple records, separated"
- " by commas;\\n");
+ " by commas;\en");
fpe("the commas are replaced by newlines before writing"
- " to map files.\\n");
+ " to map files.\en");
exit(EXIT_FAILURE);
}
map_len = strlen(mapping);
for (j = 0; j < map_len; j++)
if (mapping[j] == \(aq,\(aq)
- mapping[j] = \(aq\\n\(aq;
+ mapping[j] = \(aq\en\(aq;
fd = open(map_file, O_RDWR);
if (fd == \-1) {
- fprintf(stderr, "ERROR: open %s: %s\\n", map_file,
+ fprintf(stderr, "ERROR: open %s: %s\en", map_file,
strerror(errno));
exit(EXIT_FAILURE);
}
if (write(fd, mapping, map_len) != map_len) {
- fprintf(stderr, "ERROR: write %s: %s\\n", map_file,
+ fprintf(stderr, "ERROR: write %s: %s\en", map_file,
strerror(errno));
exit(EXIT_FAILURE);
}
user know. */
if (errno != ENOENT)
- fprintf(stderr, "ERROR: open %s: %s\\n", setgroups_path,
+ fprintf(stderr, "ERROR: open %s: %s\en", setgroups_path,
strerror(errno));
return;
}
if (write(fd, str, strlen(str)) == \-1)
- fprintf(stderr, "ERROR: write %s: %s\\n", setgroups_path,
+ fprintf(stderr, "ERROR: write %s: %s\en", setgroups_path,
strerror(errno));
close(fd);
when parent closes its descriptor */
if (read(args\->pipe_fd[0], &ch, 1) != 0) {
fprintf(stderr,
- "Failure in child: read from pipe returned != 0\\n");
+ "Failure in child: read from pipe returned != 0\en");
exit(EXIT_FAILURE);
}
/* Execute a shell command */
- printf("About to exec %s\\n", args\->argv[0]);
+ printf("About to exec %s\en", args\->argv[0]);
execvp(args\->argv[0], args\->argv);
errExit("execvp");
}
/* Parent falls through to here */
if (verbose)
- printf("%s: PID of child created by clone() is %ld\\n",
+ printf("%s: PID of child created by clone() is %ld\en",
argv[0], (long) child_pid);
/* Update the UID and GID maps in the child */
errExit("waitpid");
if (verbose)
- printf("%s: terminating\\n", argv[0]);
+ printf("%s: terminating\en", argv[0]);
exit(EXIT_SUCCESS);
}
Unicode encoding (known as UCS-2)
consists of a sequence of 16-bit words.
Such strings can contain\(emas part of many 16-bit characters\(embytes
-such as \(aq\\0\(aq or \(aq/\(aq, which have a
+such as \(aq\e0\(aq or \(aq/\(aq, which have a
special meaning in filenames and other C library function arguments.
In addition, the majority of UNIX tools expect ASCII files and can't
read 16-bit words as characters without major modifications.
All UCS characters greater than 0x7f are encoded as a multibyte sequence
consisting only of bytes in the range 0x80 to 0xfd, so no ASCII
byte can appear as part of another character and there are no
-problems with, for example, \(aq\\0\(aq or \(aq/\(aq.
+problems with, for example, \(aq\e0\(aq or \(aq/\(aq.
.TP
*
The lexicographic sorting order of UCS-4 strings is preserved.
The official ESC sequence to switch from an ISO 2022
encoding scheme (as used for instance by VT100 terminals) to
UTF-8 is ESC % G
-("\\x1b%G").
+("\ex1b%G").
The corresponding return sequence from
-UTF-8 to ISO 2022 is ESC % @ ("\\x1b%@").
+UTF-8 to ISO 2022 is ESC % @ ("\ex1b%@").
Other ISO 2022 sequences (such as
for switching the G0 and G1 sets) are not applicable in UTF-8 mode.
.SS Security