kernels/linux-2.4.0/arch/parisc/hpux/sys_hpux.c
/*  Note: HP-UX just uses the old suser() function to check perms
 *  in this system call.  We'll use capable(CAP_SYS_ADMIN).
 */
HP-UX just uses the old suser() function to check perms
in this system call.
HP - UX just uses the old suser () function to check perms in this system call .
int hpux_utssys(char *ubuf, int n, int type)
{
	int len;
	int error;
	switch( type ) {
	case 0:
		return( hpux_uname( (struct hpux_utsname *)ubuf ) );
		break ;
	case 1:
		return -EFAULT ;
		break ;
	case 2:
		return( hpux_ustat((dev_t)n, (struct hpux_ustat *)ubuf) );
		break ;
	case 3:
		if (!capable(CAP_SYS_ADMIN))
			return -EPERM;
		if ( n <= 0 )
			return -EINVAL ;
		len = (n <= __NEW_UTS_LEN) ? n : __NEW_UTS_LEN ;
		return( sys_sethostname(ubuf, len) );
		break ;
	case 4:
		if (!capable(CAP_SYS_ADMIN))
			return -EPERM;
		if ( n <= 0 )
			return -EINVAL ;
		len = (n <= __NEW_UTS_LEN) ? n : __NEW_UTS_LEN ;
		return( sys_sethostname(ubuf, len) );
		break ;
	case 5:
		if ( n <= 0 )
			return -EINVAL ;
		return( sys_gethostname(ubuf, n) );
		break ;
	case 6:
		if (!capable(CAP_SYS_ADMIN))
			return -EPERM;
		if ( n <= 0 )
			return -EINVAL ;
		len = (n <= __NEW_UTS_LEN) ? n : __NEW_UTS_LEN ;
		down_write(&uts_sem);
		error = -EFAULT;
		if (!copy_from_user(system_utsname.sysname, ubuf, len)) {
			system_utsname.sysname[len] = 0;
			error = 0;
		}
		up_write(&uts_sem);
		return error;
		break ;
	case 7:
		if (!capable(CAP_SYS_ADMIN))
			return -EPERM;
		if ( n <= 0 )
			return -EINVAL ;
		len = (n <= __NEW_UTS_LEN) ? n : __NEW_UTS_LEN ;
		down_write(&uts_sem);
		error = -EFAULT;
		if (!copy_from_user(system_utsname.release, ubuf, len)) {
			system_utsname.release[len] = 0;
			error = 0;
		}
		up_write(&uts_sem);
		return error;
		break ;
	default:
		return -EFAULT ;
	}
}
int hpux_utssys ( char * ubuf , int n , int type ) { int len ; int error ; switch ( type ) { case 0 : return ( hpux_uname ( ( struct hpux_utsname * ) ubuf ) ) ; break ; case 1 : return - EFAULT ; break ; case 2 : return ( hpux_ustat ( ( dev_t ) n , ( struct hpux_ustat * ) ubuf ) ) ; break ; case 3 : if ( ! capable ( CAP_SYS_ADMIN ) ) return - EPERM ; if ( n <= 0 ) return - EINVAL ; len = ( n <= __NEW_UTS_LEN ) ? n : __NEW_UTS_LEN ; return ( sys_sethostname ( ubuf , len ) ) ; break ; case 4 : if ( ! capable ( CAP_SYS_ADMIN ) ) return - EPERM ; if ( n <= 0 ) return - EINVAL ; len = ( n <= __NEW_UTS_LEN ) ? n : __NEW_UTS_LEN ; return ( sys_sethostname ( ubuf , len ) ) ; break ; case 5 : if ( n <= 0 ) return - EINVAL ; return ( sys_gethostname ( ubuf , n ) ) ; break ; case 6 : if ( ! capable ( CAP_SYS_ADMIN ) ) return - EPERM ; if ( n <= 0 ) return - EINVAL ; len = ( n <= __NEW_UTS_LEN ) ? n : __NEW_UTS_LEN ; down_write ( & uts_sem ) ; error = - EFAULT ; if ( ! copy_from_user ( system_utsname . sysname , ubuf , len ) ) { system_utsname . sysname [ len ] = 0 ; error = 0 ; } up_write ( & uts_sem ) ; return error ; break ; case 7 : if ( ! capable ( CAP_SYS_ADMIN ) ) return - EPERM ; if ( n <= 0 ) return - EINVAL ; len = ( n <= __NEW_UTS_LEN ) ? n : __NEW_UTS_LEN ; down_write ( & uts_sem ) ; error = - EFAULT ; if ( ! copy_from_user ( system_utsname . release , ubuf , len ) ) { system_utsname . release [ len ] = 0 ; error = 0 ; } up_write ( & uts_sem ) ; return error ; break ; default : return - EFAULT ; } }
Note: HP-UX just uses the old suser() function to check perms
  in this system call.
Note : HP - UX just uses the old suser () function to check perms in this system call .
/*  uname():  */ /*  Obsolete (used to be umask().)  */ /*  ustat():  */ /*  setuname():
		 *
		 *  On linux (unlike HP-UX), utsname.nodename
		 *  is the same as the hostname.
		 *
		 *  sys_sethostname() is defined in linux/kernel/sys.c.
		 */ /*  Unlike Linux, HP-UX returns an error if n==0:  */ /*  Unlike Linux, HP-UX truncates it if n is too big:  */ /*  sethostname():
		 *
		 *  sys_sethostname() is defined in linux/kernel/sys.c.
		 */ /*  Unlike Linux, HP-UX returns an error if n==0:  */ /*  Unlike Linux, HP-UX truncates it if n is too big:  */ /*  gethostname():
		 *
		 *  sys_gethostname() is defined in linux/kernel/sys.c.
		 */ /*  Unlike Linux, HP-UX returns an error if n==0:  */ /*  Supposedly called from setuname() in libc.
		 *  TODO: When and why is this called?
		 *        Is it ever even called?
		 *
		 *  This code should look a lot like sys_sethostname(),
		 *  defined in linux/kernel/sys.c.  If that gets updated,
		 *  update this code similarly.
		 */ /*  Unlike Linux, HP-UX returns an error if n==0:  */ /*  Unlike Linux, HP-UX truncates it if n is too big:  */ /**/ /*  TODO:  print a warning about using this?  */ /*  Sets utsname.release, if you're allowed.
		 *  Undocumented.  Used by swinstall to change the
		 *  OS version, during OS updates.  Yuck!!!
		 *
		 *  This code should look a lot like sys_sethostname()
		 *  in linux/kernel/sys.c.  If that gets updated, update
		 *  this code similarly.
		 */ /*  Unlike Linux, HP-UX returns an error if n==0:  */ /*  Unlike Linux, HP-UX truncates it if n is too big:  */ /**/ /*  TODO:  print a warning about this?  */ /*  This system call returns -EFAULT if given an unknown type.
	 	 *  Why not -EINVAL?  I don't know, it's just not what they did.
	 	 */