mirror of https://github.com/mkerrisk/man-pages
ldd.1, execve.2, getdents.2, quotactl.2, select_tut.2, clock_getcpuclockid.3, fopencookie.3, getservent_r.3, matherr.3, mq_notify.3, pthread_create.3, pthread_getattr_np.3, wordexp.3: Global fix: s/-/\\-/ when real hyphen is required (e.g., in code)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
352c778d01
commit
72da9ef157
|
@ -43,7 +43,7 @@ on an untrusted executable,
|
||||||
since this may result in the execution of arbitrary code.
|
since this may result in the execution of arbitrary code.
|
||||||
A safer alternative when dealing with untrusted executables is:
|
A safer alternative when dealing with untrusted executables is:
|
||||||
|
|
||||||
$ objdump -p /path/to/program | grep NEEDED
|
$ objdump \-p /path/to/program | grep NEEDED
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.TP
|
.TP
|
||||||
.B \-\-version
|
.B \-\-version
|
||||||
|
|
|
@ -567,7 +567,7 @@ main(int argc, char *argv[])
|
||||||
char *newenviron[] = { NULL };
|
char *newenviron[] = { NULL };
|
||||||
|
|
||||||
if (argc != 2) {
|
if (argc != 2) {
|
||||||
fprintf(stderr, "Usage: %s <file-to-exec>\\n", argv[0]);
|
fprintf(stderr, "Usage: %s <file\-to\-exec>\\n", argv[0]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -254,12 +254,12 @@ main(int argc, char *argv[])
|
||||||
if (nread == 0)
|
if (nread == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
printf("\--------------- nread=%d ---------------\\n", nread);
|
printf("\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- nread=%d \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\\n", nread);
|
||||||
printf("i\-node# file type d_reclen d_off d_name\\n");
|
printf("i\-node# file type d_reclen d_off d_name\\n");
|
||||||
for (bpos = 0; bpos < nread;) {
|
for (bpos = 0; bpos < nread;) {
|
||||||
d = (struct linux_dirent *) (buf + bpos);
|
d = (struct linux_dirent *) (buf + bpos);
|
||||||
printf("%8ld ", d\->d_ino);
|
printf("%8ld ", d\->d_ino);
|
||||||
d_type = *(buf + bpos + d\->d_reclen - 1);
|
d_type = *(buf + bpos + d\->d_reclen \- 1);
|
||||||
printf("%\-10s ", (d_type == DT_REG) ? "regular" :
|
printf("%\-10s ", (d_type == DT_REG) ? "regular" :
|
||||||
(d_type == DT_DIR) ? "directory" :
|
(d_type == DT_DIR) ? "directory" :
|
||||||
(d_type == DT_FIFO) ? "FIFO" :
|
(d_type == DT_FIFO) ? "FIFO" :
|
||||||
|
@ -268,7 +268,7 @@ main(int argc, char *argv[])
|
||||||
(d_type == DT_BLK) ? "block dev" :
|
(d_type == DT_BLK) ? "block dev" :
|
||||||
(d_type == DT_CHR) ? "char dev" : "???");
|
(d_type == DT_CHR) ? "char dev" : "???");
|
||||||
printf("%4d %10lld %s\\n", d\->d_reclen,
|
printf("%4d %10lld %s\\n", d\->d_reclen,
|
||||||
(long long) d\->d_off, d->d_name);
|
(long long) d\->d_off, d\->d_name);
|
||||||
bpos += d\->d_reclen;
|
bpos += d\->d_reclen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,8 +140,8 @@ as follows:
|
||||||
.in +4n
|
.in +4n
|
||||||
.nf
|
.nf
|
||||||
|
|
||||||
/* uint64_t is an unsigned 64-bit integer;
|
/* uint64_t is an unsigned 64\-bit integer;
|
||||||
uint32_t is an unsigned 32-bit integer */
|
uint32_t is an unsigned 32-\bit integer */
|
||||||
|
|
||||||
struct dqblk { /* Definition since Linux 2.4.22 */
|
struct dqblk { /* Definition since Linux 2.4.22 */
|
||||||
uint64_t dqb_bhardlimit; /* absolute limit on disk
|
uint64_t dqb_bhardlimit; /* absolute limit on disk
|
||||||
|
@ -227,8 +227,8 @@ as follows:
|
||||||
.in +4n
|
.in +4n
|
||||||
.nf
|
.nf
|
||||||
|
|
||||||
/* uint64_t is an unsigned 64-bit integer;
|
/* uint64_t is an unsigned 64\-bit integer;
|
||||||
uint32_t is an unsigned 32-bit integer */
|
uint32_t is an unsigned 32\-bit integer */
|
||||||
|
|
||||||
struct dqinfo { /* Defined since kernel 2.4.22 */
|
struct dqinfo { /* Defined since kernel 2.4.22 */
|
||||||
uint64_t dqi_bgrace; /* Time before block soft limit
|
uint64_t dqi_bgrace; /* Time before block soft limit
|
||||||
|
|
|
@ -638,8 +638,8 @@ main(int argc, char *argv[])
|
||||||
int buf2_avail, buf2_written;
|
int buf2_avail, buf2_written;
|
||||||
|
|
||||||
if (argc != 4) {
|
if (argc != 4) {
|
||||||
fprintf(stderr, "Usage\\n\\tfwd <listen-port> "
|
fprintf(stderr, "Usage\\n\\tfwd <listen\-port> "
|
||||||
"<forward-to-port> <forward-to-ip-address>\\n");
|
"<forward\-to\-port> <forward\-to\-ip\-address>\\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ main(int argc, char *argv[])
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
|
|
||||||
if (argc != 2) {
|
if (argc != 2) {
|
||||||
fprintf(stderr, "%s <process-ID>\\n", argv[0]);
|
fprintf(stderr, "%s <process\-ID>\\n", argv[0]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -293,8 +293,8 @@ memfile_write(void *c, const char *buf, size_t size)
|
||||||
|
|
||||||
/* Buffer too small? Keep doubling size until big enough */
|
/* Buffer too small? Keep doubling size until big enough */
|
||||||
|
|
||||||
while (size + cookie\->offset > cookie->allocated) {
|
while (size + cookie\->offset > cookie\->allocated) {
|
||||||
new_buff = realloc(cookie\->buf, cookie->allocated * 2);
|
new_buff = realloc(cookie\->buf, cookie\->allocated * 2);
|
||||||
if (new_buff == NULL) {
|
if (new_buff == NULL) {
|
||||||
return \-1;
|
return \-1;
|
||||||
} else {
|
} else {
|
||||||
|
@ -303,11 +303,11 @@ memfile_write(void *c, const char *buf, size_t size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(cookie\->buf + cookie->offset, buf, size);
|
memcpy(cookie\->buf + cookie\->offset, buf, size);
|
||||||
|
|
||||||
cookie\->offset += size;
|
cookie\->offset += size;
|
||||||
if (cookie\->offset > cookie->endpos)
|
if (cookie\->offset > cookie\->endpos)
|
||||||
cookie\->endpos = cookie->offset;
|
cookie\->endpos = cookie\->offset;
|
||||||
|
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
@ -321,12 +321,12 @@ memfile_read(void *c, char *buf, size_t size)
|
||||||
/* Fetch minimum of bytes requested and bytes available */
|
/* Fetch minimum of bytes requested and bytes available */
|
||||||
|
|
||||||
xbytes = size;
|
xbytes = size;
|
||||||
if (cookie\->offset + size > cookie->endpos)
|
if (cookie\->offset + size > cookie\->endpos)
|
||||||
xbytes = cookie\->endpos - cookie->offset;
|
xbytes = cookie\->endpos \- cookie\->offset;
|
||||||
if (xbytes < 0) /* offset may be past endpos */
|
if (xbytes < 0) /* offset may be past endpos */
|
||||||
xbytes = 0;
|
xbytes = 0;
|
||||||
|
|
||||||
memcpy(buf, cookie\->buf + cookie->offset, xbytes);
|
memcpy(buf, cookie\->buf + cookie\->offset, xbytes);
|
||||||
|
|
||||||
cookie\->offset += xbytes;
|
cookie\->offset += xbytes;
|
||||||
return xbytes;
|
return xbytes;
|
||||||
|
|
|
@ -179,7 +179,7 @@ main(int argc, char *argv[])
|
||||||
char **p;
|
char **p;
|
||||||
|
|
||||||
if (argc < 3) {
|
if (argc < 3) {
|
||||||
printf("Usage: %s port\-num proto-name [buflen]\\n", argv[0]);
|
printf("Usage: %s port\-num proto\-name [buflen]\\n", argv[0]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -382,7 +382,7 @@ matherr(struct exception *exc)
|
||||||
(exc\->type == PLOSS) ? "PLOSS" : "???",
|
(exc\->type == PLOSS) ? "PLOSS" : "???",
|
||||||
exc\->name);
|
exc\->name);
|
||||||
fprintf(stderr, " args: %f, %f\\n",
|
fprintf(stderr, " args: %f, %f\\n",
|
||||||
exc\->arg1, exc->arg2);
|
exc\->arg1, exc\->arg2);
|
||||||
fprintf(stderr, " retval: %f\\n", exc\->retval);
|
fprintf(stderr, " retval: %f\\n", exc\->retval);
|
||||||
|
|
||||||
if (change_retval)
|
if (change_retval)
|
||||||
|
@ -398,7 +398,7 @@ main(int argc, char *argv[])
|
||||||
|
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
fprintf(stderr, "Usage: %s <argval>"
|
fprintf(stderr, "Usage: %s <argval>"
|
||||||
" [<matherr\-ret> [<new\-func-retval>]]\\n", argv[0]);
|
" [<matherr\-ret> [<new\-func\-retval>]]\\n", argv[0]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -222,7 +222,7 @@ main(int argc, char *argv[])
|
||||||
struct sigevent sev;
|
struct sigevent sev;
|
||||||
|
|
||||||
if (argc != 2) {
|
if (argc != 2) {
|
||||||
fprintf(stderr, "Usage: %s <mq-name>\\n", argv[0]);
|
fprintf(stderr, "Usage: %s <mq\-name>\\n", argv[0]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -269,7 +269,7 @@ thread_start(void *arg)
|
||||||
char *uargv, *p;
|
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\\n",
|
||||||
tinfo\->thread_num, &p, tinfo->argv_string);
|
tinfo\->thread_num, &p, tinfo\->argv_string);
|
||||||
|
|
||||||
uargv = strdup(tinfo\->argv_string);
|
uargv = strdup(tinfo\->argv_string);
|
||||||
if (uargv == NULL)
|
if (uargv == NULL)
|
||||||
|
|
|
@ -241,8 +241,8 @@ usage(char *pname, char *msg)
|
||||||
{
|
{
|
||||||
if (msg != NULL)
|
if (msg != NULL)
|
||||||
fputs(msg, stderr);
|
fputs(msg, stderr);
|
||||||
fprintf(stderr, "Usage: %s [\-s stack-size [\-a]]"
|
fprintf(stderr, "Usage: %s [\-s stack\-size [\-a]]"
|
||||||
" [\-g guard-size]\\n", pname);
|
" [\-g guard\-size]\\n", pname);
|
||||||
fprintf(stderr, "\\t\\t\-a means program should allocate stack\\n");
|
fprintf(stderr, "\\t\\t\-a means program should allocate stack\\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -201,7 +201,7 @@ main(int argc, char **argv)
|
||||||
char **w;
|
char **w;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
wordexp("[a-c]*.c", &p, 0);
|
wordexp("[a\-c]*.c", &p, 0);
|
||||||
w = p.we_wordv;
|
w = p.we_wordv;
|
||||||
for (i = 0; i < p.we_wordc; i++)
|
for (i = 0; i < p.we_wordc; i++)
|
||||||
printf("%s\en", w[i]);
|
printf("%s\en", w[i]);
|
||||||
|
|
Loading…
Reference in New Issue