Skip to content

Commit 2854c77

Browse files
Add O_CLOFORK flags to sysdecode
1 parent f05c2f6 commit 2854c77

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

lib/libsysdecode/flags.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ sysdecode_vmprot(FILE *fp, int type, int *rem)
196196
}
197197

198198
static struct name_table sockflags[] = {
199-
X(SOCK_CLOEXEC) X(SOCK_NONBLOCK) XEND
199+
X(SOCK_CLOEXEC) X(SOCK_CLOFORK) X(SOCK_NONBLOCK) XEND
200200
};
201201

202202
bool
@@ -206,16 +206,17 @@ sysdecode_socket_type(FILE *fp, int type, int *rem)
206206
uintmax_t val;
207207
bool printed;
208208

209-
str = lookup_value(socktype, type & ~(SOCK_CLOEXEC | SOCK_NONBLOCK));
209+
str = lookup_value(socktype,
210+
type & ~(SOCK_CLOEXEC | SOCK_CLOFORK | SOCK_NONBLOCK));
210211
if (str != NULL) {
211212
fputs(str, fp);
212213
*rem = 0;
213214
printed = true;
214215
} else {
215-
*rem = type & ~(SOCK_CLOEXEC | SOCK_NONBLOCK);
216+
*rem = type & ~(SOCK_CLOEXEC | SOCK_CLOFORK | SOCK_NONBLOCK);
216217
printed = false;
217218
}
218-
val = type & (SOCK_CLOEXEC | SOCK_NONBLOCK);
219+
val = type & (SOCK_CLOEXEC | SOCK_CLOFORK | SOCK_NONBLOCK);
219220
print_mask_part(fp, sockflags, &val, &printed);
220221
return (printed);
221222
}
@@ -556,7 +557,7 @@ sysdecode_nfssvc_flags(int flags)
556557
}
557558

558559
static struct name_table pipe2flags[] = {
559-
X(O_CLOEXEC) X(O_NONBLOCK) XEND
560+
X(O_CLOEXEC) X(O_CLOFORK) X(O_NONBLOCK) XEND
560561
};
561562

562563
bool
@@ -866,7 +867,7 @@ sysdecode_fcntl_cmd(int cmd)
866867
}
867868

868869
static struct name_table fcntl_fd_arg[] = {
869-
X(FD_CLOEXEC) X(0) XEND
870+
X(FD_CLOEXEC) X(FD_CLOFORK) X(0) XEND
870871
};
871872

872873
bool

lib/libsysdecode/sysdecode_fcntl_arg.3

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ are determined by
5454
.It Sy Command Ta Fa arg Sy Type Ta Sy Output Format
5555
.It
5656
.It Dv F_SETFD Ta Vt int Ta
57-
.Dq FD_CLOEXEC
57+
.Dq FD_CLOEXEC ,
58+
.Dq FD_CLOFORK
5859
or the value of
5960
.Fa arg
6061
in the indicated

0 commit comments

Comments
 (0)