mirror of
https://github.com/opnsense/src.git
synced 2026-06-10 09:11:07 -04:00
Add debuging printfs to syscalls that do not contain it yet. In
sethostname do not print the hostname because it would require to copyin the string. Sethostname is not very frequently used. Submitted by: rdivacky
This commit is contained in:
parent
f472c6e35a
commit
d559d18183
1 changed files with 36 additions and 0 deletions
|
|
@ -1378,6 +1378,11 @@ linux_getpid(struct thread *td, struct linux_getpid_args *args)
|
|||
struct linux_emuldata *em;
|
||||
char osrel[LINUX_MAX_UTSNAME];
|
||||
|
||||
#ifdef DEBUG
|
||||
if (ldebug(getpid))
|
||||
printf(ARGS(getpid, ""));
|
||||
#endif
|
||||
|
||||
linux_get_osrelease(td, osrel);
|
||||
if (strlen(osrel) >= 3 && osrel[2] == '6') {
|
||||
em = em_find(td->td_proc, EMUL_UNLOCKED);
|
||||
|
|
@ -1411,6 +1416,11 @@ linux_getppid(struct thread *td, struct linux_getppid_args *args)
|
|||
struct proc *p, *pp;
|
||||
char osrel[LINUX_MAX_UTSNAME];
|
||||
|
||||
#ifdef DEBUG
|
||||
if (ldebug(getppid))
|
||||
printf(ARGS(getppid, ""));
|
||||
#endif
|
||||
|
||||
linux_get_osrelease(td, osrel);
|
||||
if (strlen(osrel) >= 3 && osrel[2] != '6') {
|
||||
PROC_LOCK(td->td_proc);
|
||||
|
|
@ -1456,6 +1466,11 @@ int
|
|||
linux_getgid(struct thread *td, struct linux_getgid_args *args)
|
||||
{
|
||||
|
||||
#ifdef DEBUG
|
||||
if (ldebug(getgid))
|
||||
printf(ARGS(getgid, ""));
|
||||
#endif
|
||||
|
||||
td->td_retval[0] = td->td_ucred->cr_rgid;
|
||||
return (0);
|
||||
}
|
||||
|
|
@ -1464,6 +1479,11 @@ int
|
|||
linux_getuid(struct thread *td, struct linux_getuid_args *args)
|
||||
{
|
||||
|
||||
#ifdef DEBUG
|
||||
if (ldebug(getuid))
|
||||
printf(ARGS(getuid, ""));
|
||||
#endif
|
||||
|
||||
td->td_retval[0] = td->td_ucred->cr_ruid;
|
||||
return (0);
|
||||
}
|
||||
|
|
@ -1473,6 +1493,12 @@ int
|
|||
linux_getsid(struct thread *td, struct linux_getsid_args *args)
|
||||
{
|
||||
struct getsid_args bsd;
|
||||
|
||||
#ifdef DEBUG
|
||||
if (ldebug(getsid))
|
||||
printf(ARGS(getsid, "%i"), args->pid);
|
||||
#endif
|
||||
|
||||
bsd.pid = args->pid;
|
||||
return getsid(td, &bsd);
|
||||
}
|
||||
|
|
@ -1490,6 +1516,11 @@ linux_getpriority(struct thread *td, struct linux_getpriority_args *args)
|
|||
struct getpriority_args bsd_args;
|
||||
int error;
|
||||
|
||||
#ifdef DEBUG
|
||||
if (ldebug(getpriority))
|
||||
printf(ARGS(getpriority, "%i, %i"), args->which, args->who);
|
||||
#endif
|
||||
|
||||
bsd_args.which = args->which;
|
||||
bsd_args.who = args->who;
|
||||
error = getpriority(td, &bsd_args);
|
||||
|
|
@ -1502,6 +1533,11 @@ linux_sethostname(struct thread *td, struct linux_sethostname_args *args)
|
|||
{
|
||||
int name[2];
|
||||
|
||||
#ifdef DEBUG
|
||||
if (ldebug(sethostname))
|
||||
printf(ARGS(sethostname, "*, %i"), args->len);
|
||||
#endif
|
||||
|
||||
name[0] = CTL_KERN;
|
||||
name[1] = KERN_HOSTNAME;
|
||||
return (userland_sysctl(td, name, 2, 0, 0, 0, args->hostname,
|
||||
|
|
|
|||
Loading…
Reference in a new issue