Decode file flags passed to *chflags*().
While here, decode arguments passed to fchflags() and chflagsat().
This commit is contained in:
parent
54ec725bf3
commit
27459358ed
|
@ -45,7 +45,7 @@ enum Argtype { None = 1, Hex, Octal, Int, UInt, LongHex, Name, Ptr, Stat, Ioctl,
|
||||||
Pathconf, Rforkflags, ExitStatus, Waitoptions, Idtype, Procctl,
|
Pathconf, Rforkflags, ExitStatus, Waitoptions, Idtype, Procctl,
|
||||||
LinuxSockArgs, Umtxop, Atfd, Atflags, Timespec2, Accessmode, Long,
|
LinuxSockArgs, Umtxop, Atfd, Atflags, Timespec2, Accessmode, Long,
|
||||||
Sysarch, ExecArgs, ExecEnv, PipeFds, QuadHex, Utrace, IntArray, Pipe2,
|
Sysarch, ExecArgs, ExecEnv, PipeFds, QuadHex, Utrace, IntArray, Pipe2,
|
||||||
CapFcntlRights, Fadvice,
|
CapFcntlRights, Fadvice, FileFlags,
|
||||||
|
|
||||||
CloudABIAdvice, CloudABIClockID, ClouduABIFDSFlags,
|
CloudABIAdvice, CloudABIClockID, ClouduABIFDSFlags,
|
||||||
CloudABIFDStat, CloudABIFileStat, CloudABIFileType,
|
CloudABIFDStat, CloudABIFileStat, CloudABIFileType,
|
||||||
|
|
|
@ -99,7 +99,10 @@ static struct syscall decoded_syscalls[] = {
|
||||||
{ .name = "chdir", .ret_type = 1, .nargs = 1,
|
{ .name = "chdir", .ret_type = 1, .nargs = 1,
|
||||||
.args = { { Name, 0 } } },
|
.args = { { Name, 0 } } },
|
||||||
{ .name = "chflags", .ret_type = 1, .nargs = 2,
|
{ .name = "chflags", .ret_type = 1, .nargs = 2,
|
||||||
.args = { { Name | IN, 0 }, { Hex, 1 } } },
|
.args = { { Name | IN, 0 }, { FileFlags, 1 } } },
|
||||||
|
{ .name = "chflagsat", .ret_type = 1, .nargs = 4,
|
||||||
|
.args = { { Atfd, 0 }, { Name | IN, 1 }, { FileFlags, 2 },
|
||||||
|
{ Atflags, 3 } } },
|
||||||
{ .name = "chmod", .ret_type = 1, .nargs = 2,
|
{ .name = "chmod", .ret_type = 1, .nargs = 2,
|
||||||
.args = { { Name, 0 }, { Octal, 1 } } },
|
.args = { { Name, 0 }, { Octal, 1 } } },
|
||||||
{ .name = "chown", .ret_type = 1, .nargs = 3,
|
{ .name = "chown", .ret_type = 1, .nargs = 3,
|
||||||
|
@ -125,6 +128,8 @@ static struct syscall decoded_syscalls[] = {
|
||||||
{ .name = "faccessat", .ret_type = 1, .nargs = 4,
|
{ .name = "faccessat", .ret_type = 1, .nargs = 4,
|
||||||
.args = { { Atfd, 0 }, { Name | IN, 1 }, { Accessmode, 2 },
|
.args = { { Atfd, 0 }, { Name | IN, 1 }, { Accessmode, 2 },
|
||||||
{ Atflags, 3 } } },
|
{ Atflags, 3 } } },
|
||||||
|
{ .name = "fchflags", .ret_type = 1, .nargs = 2,
|
||||||
|
.args = { { Int, 0 }, { FileFlags, 1 } } },
|
||||||
{ .name = "fchmod", .ret_type = 1, .nargs = 2,
|
{ .name = "fchmod", .ret_type = 1, .nargs = 2,
|
||||||
.args = { { Int, 0 }, { Octal, 1 } } },
|
.args = { { Int, 0 }, { Octal, 1 } } },
|
||||||
{ .name = "fchmodat", .ret_type = 1, .nargs = 4,
|
{ .name = "fchmodat", .ret_type = 1, .nargs = 4,
|
||||||
|
@ -189,7 +194,7 @@ static struct syscall decoded_syscalls[] = {
|
||||||
{ .name = "kse_release", .ret_type = 0, .nargs = 1,
|
{ .name = "kse_release", .ret_type = 0, .nargs = 1,
|
||||||
.args = { { Timespec, 0 } } },
|
.args = { { Timespec, 0 } } },
|
||||||
{ .name = "lchflags", .ret_type = 1, .nargs = 2,
|
{ .name = "lchflags", .ret_type = 1, .nargs = 2,
|
||||||
.args = { { Name | IN, 0 }, { Hex, 1 } } },
|
.args = { { Name | IN, 0 }, { FileFlags, 1 } } },
|
||||||
{ .name = "lchmod", .ret_type = 1, .nargs = 2,
|
{ .name = "lchmod", .ret_type = 1, .nargs = 2,
|
||||||
.args = { { Name, 0 }, { Octal, 1 } } },
|
.args = { { Name, 0 }, { Octal, 1 } } },
|
||||||
{ .name = "lchown", .ret_type = 1, .nargs = 3,
|
{ .name = "lchown", .ret_type = 1, .nargs = 3,
|
||||||
|
@ -1868,6 +1873,15 @@ print_arg(struct syscall_args *sc, unsigned long *args, long *retval,
|
||||||
case Fadvice:
|
case Fadvice:
|
||||||
print_integer_arg(sysdecode_fadvice, fp, args[sc->offset]);
|
print_integer_arg(sysdecode_fadvice, fp, args[sc->offset]);
|
||||||
break;
|
break;
|
||||||
|
case FileFlags: {
|
||||||
|
fflags_t rem;
|
||||||
|
|
||||||
|
if (!sysdecode_fileflags(fp, args[sc->offset], &rem))
|
||||||
|
fprintf(fp, "0x%x", rem);
|
||||||
|
else if (rem != 0)
|
||||||
|
fprintf(fp, "|0x%x", rem);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case CloudABIAdvice:
|
case CloudABIAdvice:
|
||||||
fputs(xlookup(cloudabi_advice, args[sc->offset]), fp);
|
fputs(xlookup(cloudabi_advice, args[sc->offset]), fp);
|
||||||
|
|
Loading…
Reference in New Issue