Commit Graph

12 Commits

Author SHA1 Message Date
184e94ba05 Fix a few spacing style issues
Reported by kernel's checkpatch.pl script.
2017-06-17 22:54:08 +00:00
Eugene Syromyatnikov
9d095c7860 Add copyright headers 2017-05-22 17:33:51 +00:00
9c260b9e87 Provide a safe definition of O_ACCMODE
Some libcs e.g. musl are guilty of messing up with O_ACCMODE.

* open.c (O_ACCMODE): Redefine to 03.
2016-10-29 02:54:02 +03:00
212a444bdc decode_open: print the mode argument when O_TMPFILE flag is set
O_TMPFILE reqires the mode argument (just like O_CREAT), so print it.

* open.c (STRACE_O_TMPFILE): New macro.
(decode_open): Print the mode argument when O_TMPFILE flag is set.
* tests/open.c (main): Check it.
Fixes RH#1377846.
2016-09-20 20:55:56 +00:00
8d3743868e Fix printing of mode_t, umode_t, and umask types
Print numeric umode_t type using %#03ho format.
Print return value of umask syscall using %#03lo format.
When printing symbolic mode_t type, always print lower 9 bits,
and print the numeric part using %#03o format.

* defs.h (sprintmode): Remove.
(print_symbolic_mode_t, print_numeric_umode_t,
print_numeric_long_umask): New prototypes.
* printmode.c (sprintmode): Remove.
(print_symbolic_mode_t, print_numeric_umode_t,
print_numeric_long_umask): New functions.
* chmod.c (decode_chmod): Use print_numeric_umode_t.
* ipc_msg.c (SYS_FUNC(msgget)): Likewise.
* ipc_msgctl.c (print_msqid_ds): Likewise.
* ipc_sem.c (SYS_FUNC(semget)): Likewise.
* ipc_shm.c (SYS_FUNC(shmget)): Likewise.
* ipc_shmctl.c (print_shmid_ds): Likewise.
* mq.c (SYS_FUNC(mq_open)): Likewise.
* open.c (decode_open, SYS_FUNC(creat)): Likewise.
* umask.c (SYS_FUNC(umask)): Likewise.
* mknod.c (decode_mknod): Use print_symbolic_mode_t.
* printstat.h (DO_PRINTSTAT): Likewise.
* syscall.c (trace_syscall_exiting): Use print_numeric_long_umask.
* tests/umode_t.c: New file.
* tests/Makefile.am (EXTRA_DIST): Add it.
* tests/creat.c: Rewrite as a thin wrapper around umode_t.c
* tests/mkdir.c: Likewise.
* tests/mkdirat.c: Likewise.
* tests/mknod.c: Extend test coverage of mknod syscall.
* tests/mknodat.c: Extend test coverage of mknodat syscall.
* tests/umask.c: Extend test coverage of umask syscall.
* tests/creat.test: Update the value specified for strace -a parameter.
* tests/mkdir.test: Likewise.
* tests/mkdirat.test: Likewise.
* tests/mknodat.test: Likewise.
2016-08-03 23:27:03 +00:00
dd9a511c17 Change type of {s,t}print_open_modes's argument to unsigned
As "flags" argument of sprint_open_modes and tprint_open_modes is
involved only in bit operations, change its type to unsigned.

* defs.h.c (sprint_open_modes, tprint_open_modes): Change type
to unsigned int.
* open.c (sprint_open_modes, tprint_open_modes): Likewise.
2016-04-29 00:13:20 +00:00
38a34c9349 Add copyright headers to some files which lack them
Before this change, all files that exist since 20th century had
copyright headers, while most files that appeared later didn't.  This
change fixes the inconsistency by adding missing copyright headers.

It doesn't mean that copyright headers became maintained.  In my view,
git history provides much better information on this subject and is much
more accurate than copyright headers.
2015-12-17 17:56:48 +00:00
57ae04e402 Update openat parser for the RVAL_DECODED change
* open.c (sys_openat): Update for RVAL_DECODED.
2015-07-20 22:03:07 +00:00
d62d8fd671 open.c: make use of RVAL_DECODED
* open.c (decode_open, sys_creat): Update for RVAL_DECODED.
2015-07-18 00:01:40 +00:00
a0bd3749fc Declare syscall parsers using SYS_FUNC macro
Introduce SYS_FUNC macro to declare and define all syscall parsers.

* Makefile.am (BUILT_SOURCES, CLEANFILES): Add sys_func.h.
(sys_func.h): New rule.
* defs.h (SYS_FUNC_NAME, SYS_FUNC): New macros.
* linux/syscall.h: Include "sys_func.h".
[NEED_UID16_PARSERS]: Use SYS_FUNC to declare uid16 syscall parsers.
Remove other declarations.
* linux/alpha/syscallent.h (160, 161): Add sys_ prefix to osf_statfs
and osf_fstatfs syscall parsers.
* *.c: Use SYS_FUNC to define syscall parsers.
2015-04-07 11:22:49 +00:00
Denys Vlasenko
df4dd8b540 sparc: delete personality 1
Personality 1 for sparc and sparc64 appears to be an old attempt
to support stracing Solaris binaries.

It stalled after the only syscall, solaris_open, was covered:
all other solaris_foo's are printargs.

This change deletes personality 1. Now sparc is an one-personality
arch, and sparc64 is a two-personality one.

For clarity, pure renaming of personality 2 files to personality 1 for sparc64
is performed in the next commit - this prevents a state where syscallent1.h
seems to indergo a lot of changes, where in fact in is deleted, and then
replaced by syscallent2.h

Therefore, tree at this commit will not build.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2015-03-25 15:21:57 +01:00
964d80a0f7 file.c: move open, openat, and creat parsers to a separate file
* open.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* file.c: Move sys_open, sys_openat, sys_creat, and related code
to open.c.
2014-12-11 21:40:20 +00:00