patch-2.3.15 linux/kernel/sys.c
Next file: linux/kernel/sysctl.c
Previous file: linux/kernel/signal.c
Back to the patch index
Back to the overall index
- Lines: 277
- Date:
Wed Aug 25 15:47:44 1999
- Orig file:
v2.3.14/linux/kernel/sys.c
- Orig date:
Sat Jul 3 12:04:12 1999
diff -u --recursive --new-file v2.3.14/linux/kernel/sys.c linux/kernel/sys.c
@@ -45,7 +45,7 @@
extern void adjust_clock(void);
-asmlinkage int sys_ni_syscall(void)
+asmlinkage long sys_ni_syscall(void)
{
return -ENOSYS;
}
@@ -72,7 +72,7 @@
return 0;
}
-asmlinkage int sys_setpriority(int which, int who, int niceval)
+asmlinkage long sys_setpriority(int which, int who, int niceval)
{
struct task_struct *p;
unsigned int priority;
@@ -122,7 +122,7 @@
* not return the normal nice-value, but a value that has been
* offset by 20 (ie it returns 0..40 instead of -20..20)
*/
-asmlinkage int sys_getpriority(int which, int who)
+asmlinkage long sys_getpriority(int which, int who)
{
struct task_struct *p;
long max_prio = -ESRCH;
@@ -154,7 +154,7 @@
*
* reboot doesn't sync: do that yourself before calling this.
*/
-asmlinkage int sys_reboot(int magic1, int magic2, int cmd, void * arg)
+asmlinkage long sys_reboot(int magic1, int magic2, int cmd, void * arg)
{
char buffer[256];
@@ -252,7 +252,7 @@
* SMP: There are not races, the GIDs are checked only by filesystem
* operations (as far as semantic preservation is concerned).
*/
-asmlinkage int sys_setregid(gid_t rgid, gid_t egid)
+asmlinkage long sys_setregid(gid_t rgid, gid_t egid)
{
int old_rgid = current->gid;
int old_egid = current->egid;
@@ -290,7 +290,7 @@
*
* SMP: Same implicit races as above.
*/
-asmlinkage int sys_setgid(gid_t gid)
+asmlinkage long sys_setgid(gid_t gid)
{
int old_egid = current->egid;
@@ -356,7 +356,7 @@
* 100% compatible with BSD. A program which uses just setuid() will be
* 100% compatible with POSIX with saved IDs.
*/
-asmlinkage int sys_setreuid(uid_t ruid, uid_t euid)
+asmlinkage long sys_setreuid(uid_t ruid, uid_t euid)
{
int old_ruid, old_euid, old_suid, new_ruid;
@@ -418,7 +418,7 @@
* will allow a root program to temporarily drop privileges and be able to
* regain them by swapping the real and effective uid.
*/
-asmlinkage int sys_setuid(uid_t uid)
+asmlinkage long sys_setuid(uid_t uid)
{
int old_euid = current->euid;
int old_ruid, old_suid, new_ruid;
@@ -454,7 +454,7 @@
* This function implements a generic ability to update ruid, euid,
* and suid. This allows you to implement the 4.4 compatible seteuid().
*/
-asmlinkage int sys_setresuid(uid_t ruid, uid_t euid, uid_t suid)
+asmlinkage long sys_setresuid(uid_t ruid, uid_t euid, uid_t suid)
{
int old_ruid = current->uid;
int old_euid = current->euid;
@@ -493,7 +493,7 @@
return 0;
}
-asmlinkage int sys_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid)
+asmlinkage long sys_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid)
{
int retval;
@@ -507,7 +507,7 @@
/*
* Same as above, but for rgid, egid, sgid.
*/
-asmlinkage int sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid)
+asmlinkage long sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid)
{
if (!capable(CAP_SETGID)) {
if ((rgid != (gid_t) -1) && (rgid != current->gid) &&
@@ -533,7 +533,7 @@
return 0;
}
-asmlinkage int sys_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid)
+asmlinkage long sys_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid)
{
int retval;
@@ -551,7 +551,7 @@
* whatever uid it wants to). It normally shadows "euid", except when
* explicitly set by setfsuid() or for access..
*/
-asmlinkage int sys_setfsuid(uid_t uid)
+asmlinkage long sys_setfsuid(uid_t uid)
{
int old_fsuid;
@@ -588,7 +588,7 @@
/*
* Samma på svenska..
*/
-asmlinkage int sys_setfsgid(gid_t gid)
+asmlinkage long sys_setfsgid(gid_t gid)
{
int old_fsgid;
@@ -630,7 +630,7 @@
* LBT 04.03.94
*/
-asmlinkage int sys_setpgid(pid_t pid, pid_t pgid)
+asmlinkage long sys_setpgid(pid_t pid, pid_t pgid)
{
struct task_struct * p;
int err = -EINVAL;
@@ -683,7 +683,7 @@
return err;
}
-asmlinkage int sys_getpgid(pid_t pid)
+asmlinkage long sys_getpgid(pid_t pid)
{
if (!pid) {
return current->pgrp;
@@ -702,13 +702,13 @@
}
}
-asmlinkage int sys_getpgrp(void)
+asmlinkage long sys_getpgrp(void)
{
/* SMP - assuming writes are word atomic this is fine */
return current->pgrp;
}
-asmlinkage int sys_getsid(pid_t pid)
+asmlinkage long sys_getsid(pid_t pid)
{
if (!pid) {
return current->session;
@@ -727,7 +727,7 @@
}
}
-asmlinkage int sys_setsid(void)
+asmlinkage long sys_setsid(void)
{
struct task_struct * p;
int err = -EPERM;
@@ -751,7 +751,7 @@
/*
* Supplementary group IDs
*/
-asmlinkage int sys_getgroups(int gidsetsize, gid_t *grouplist)
+asmlinkage long sys_getgroups(int gidsetsize, gid_t *grouplist)
{
int i;
@@ -777,7 +777,7 @@
* without another task interfering.
*/
-asmlinkage int sys_setgroups(int gidsetsize, gid_t *grouplist)
+asmlinkage long sys_setgroups(int gidsetsize, gid_t *grouplist)
{
if (!capable(CAP_SETGID))
return -EPERM;
@@ -815,7 +815,7 @@
*/
DECLARE_MUTEX(uts_sem);
-asmlinkage int sys_newuname(struct new_utsname * name)
+asmlinkage long sys_newuname(struct new_utsname * name)
{
int errno = 0;
@@ -826,7 +826,7 @@
return errno;
}
-asmlinkage int sys_sethostname(char *name, int len)
+asmlinkage long sys_sethostname(char *name, int len)
{
int errno;
@@ -844,7 +844,7 @@
return errno;
}
-asmlinkage int sys_gethostname(char *name, int len)
+asmlinkage long sys_gethostname(char *name, int len)
{
int i, errno;
@@ -865,7 +865,7 @@
* Only setdomainname; getdomainname can be implemented by calling
* uname()
*/
-asmlinkage int sys_setdomainname(char *name, int len)
+asmlinkage long sys_setdomainname(char *name, int len)
{
int errno;
@@ -884,7 +884,7 @@
return errno;
}
-asmlinkage int sys_getrlimit(unsigned int resource, struct rlimit *rlim)
+asmlinkage long sys_getrlimit(unsigned int resource, struct rlimit *rlim)
{
if (resource >= RLIM_NLIMITS)
return -EINVAL;
@@ -893,7 +893,7 @@
? -EFAULT : 0;
}
-asmlinkage int sys_setrlimit(unsigned int resource, struct rlimit *rlim)
+asmlinkage long sys_setrlimit(unsigned int resource, struct rlimit *rlim)
{
struct rlimit new_rlim, *old_rlim;
@@ -970,21 +970,21 @@
return copy_to_user(ru, &r, sizeof(r)) ? -EFAULT : 0;
}
-asmlinkage int sys_getrusage(int who, struct rusage *ru)
+asmlinkage long sys_getrusage(int who, struct rusage *ru)
{
if (who != RUSAGE_SELF && who != RUSAGE_CHILDREN)
return -EINVAL;
return getrusage(current, who, ru);
}
-asmlinkage int sys_umask(int mask)
+asmlinkage long sys_umask(int mask)
{
mask = xchg(¤t->fs->umask, mask & S_IRWXUGO);
return mask;
}
-asmlinkage int sys_prctl(int option, unsigned long arg2, unsigned long arg3,
- unsigned long arg4, unsigned long arg5)
+asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,
+ unsigned long arg4, unsigned long arg5)
{
int error = 0;
int sig;
@@ -997,6 +997,9 @@
break;
}
current->pdeath_signal = sig;
+ break;
+ case PR_GET_PDEATHSIG:
+ error = put_user(current->pdeath_signal, (int *)arg2);
break;
default:
error = -EINVAL;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)