USB: Phidgets should check create_device_file() return value
[linux/fpc-iii.git] / arch / parisc / hpux / sys_hpux.c
blobcb69727027aecf66889bad82a29e947bf87cb994
1 /*
2 * Implements HPUX syscalls.
4 * Copyright (C) 1999 Matthew Wilcox <willy with parisc-linux.org>
5 * Copyright (C) 2000 Philipp Rumpf
6 * Copyright (C) 2000 John Marvin <jsm with parisc-linux.org>
7 * Copyright (C) 2000 Michael Ang <mang with subcarrier.org>
8 * Copyright (C) 2001 Nathan Neulinger <nneul at umr.edu>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include <linux/capability.h>
26 #include <linux/file.h>
27 #include <linux/fs.h>
28 #include <linux/namei.h>
29 #include <linux/sched.h>
30 #include <linux/slab.h>
31 #include <linux/smp_lock.h>
32 #include <linux/syscalls.h>
33 #include <linux/utsname.h>
34 #include <linux/vfs.h>
35 #include <linux/vmalloc.h>
37 #include <asm/errno.h>
38 #include <asm/pgalloc.h>
39 #include <asm/uaccess.h>
41 unsigned long hpux_brk(unsigned long addr)
43 /* Sigh. Looks like HP/UX libc relies on kernel bugs. */
44 return sys_brk(addr + PAGE_SIZE);
47 int hpux_sbrk(void)
49 return -ENOSYS;
52 /* Random other syscalls */
54 int hpux_nice(int priority_change)
56 return -ENOSYS;
59 int hpux_ptrace(void)
61 return -ENOSYS;
64 int hpux_wait(int *stat_loc)
66 return sys_waitpid(-1, stat_loc, 0);
69 int hpux_setpgrp(void)
71 return sys_setpgid(0,0);
74 int hpux_setpgrp3(void)
76 return hpux_setpgrp();
79 #define _SC_CPU_VERSION 10001
80 #define _SC_OPEN_MAX 4
81 #define CPU_PA_RISC1_1 0x210
83 int hpux_sysconf(int which)
85 switch (which) {
86 case _SC_CPU_VERSION:
87 return CPU_PA_RISC1_1;
88 case _SC_OPEN_MAX:
89 return INT_MAX;
90 default:
91 return -EINVAL;
95 /*****************************************************************************/
97 #define HPUX_UTSLEN 9
98 #define HPUX_SNLEN 15
100 struct hpux_utsname {
101 char sysname[HPUX_UTSLEN];
102 char nodename[HPUX_UTSLEN];
103 char release[HPUX_UTSLEN];
104 char version[HPUX_UTSLEN];
105 char machine[HPUX_UTSLEN];
106 char idnumber[HPUX_SNLEN];
109 struct hpux_ustat {
110 int32_t f_tfree; /* total free (daddr_t) */
111 u_int32_t f_tinode; /* total inodes free (ino_t) */
112 char f_fname[6]; /* filsys name */
113 char f_fpack[6]; /* filsys pack name */
114 u_int32_t f_blksize; /* filsys block size (int) */
118 * HPUX's utssys() call. It's a collection of miscellaneous functions,
119 * alas, so there's no nice way of splitting them up.
122 /* This function is called from hpux_utssys(); HP-UX implements
123 * ustat() as an option to utssys().
125 * Now, struct ustat on HP-UX is exactly the same as on Linux, except
126 * that it contains one addition field on the end, int32_t f_blksize.
127 * So, we could have written this function to just call the Linux
128 * sys_ustat(), (defined in linux/fs/super.c), and then just
129 * added this additional field to the user's structure. But I figure
130 * if we're gonna be digging through filesystem structures to get
131 * this, we might as well just do the whole enchilada all in one go.
133 * So, most of this function is almost identical to sys_ustat().
134 * I have placed comments at the few lines changed or added, to
135 * aid in porting forward if and when sys_ustat() is changed from
136 * its form in kernel 2.2.5.
138 static int hpux_ustat(dev_t dev, struct hpux_ustat __user *ubuf)
140 struct super_block *s;
141 struct hpux_ustat tmp; /* Changed to hpux_ustat */
142 struct kstatfs sbuf;
143 int err = -EINVAL;
145 s = user_get_super(dev);
146 if (s == NULL)
147 goto out;
148 err = vfs_statfs(s->s_root, &sbuf);
149 drop_super(s);
150 if (err)
151 goto out;
153 memset(&tmp,0,sizeof(tmp));
155 tmp.f_tfree = (int32_t)sbuf.f_bfree;
156 tmp.f_tinode = (u_int32_t)sbuf.f_ffree;
157 tmp.f_blksize = (u_int32_t)sbuf.f_bsize; /* Added this line */
159 err = copy_to_user(ubuf, &tmp, sizeof(tmp)) ? -EFAULT : 0;
160 out:
161 return err;
165 * Wrapper for hpux statfs call. At the moment, just calls the linux native one
166 * and ignores the extra fields at the end of the hpux statfs struct.
170 typedef int32_t hpux_fsid_t[2]; /* file system ID type */
171 typedef uint16_t hpux_site_t;
173 struct hpux_statfs {
174 int32_t f_type; /* type of info, zero for now */
175 int32_t f_bsize; /* fundamental file system block size */
176 int32_t f_blocks; /* total blocks in file system */
177 int32_t f_bfree; /* free block in fs */
178 int32_t f_bavail; /* free blocks avail to non-superuser */
179 int32_t f_files; /* total file nodes in file system */
180 int32_t f_ffree; /* free file nodes in fs */
181 hpux_fsid_t f_fsid; /* file system ID */
182 int32_t f_magic; /* file system magic number */
183 int32_t f_featurebits; /* file system features */
184 int32_t f_spare[4]; /* spare for later */
185 hpux_site_t f_cnode; /* cluster node where mounted */
186 int16_t f_pad;
189 static int vfs_statfs_hpux(struct dentry *dentry, struct hpux_statfs *buf)
191 struct kstatfs st;
192 int retval;
194 retval = vfs_statfs(dentry, &st);
195 if (retval)
196 return retval;
198 memset(buf, 0, sizeof(*buf));
199 buf->f_type = st.f_type;
200 buf->f_bsize = st.f_bsize;
201 buf->f_blocks = st.f_blocks;
202 buf->f_bfree = st.f_bfree;
203 buf->f_bavail = st.f_bavail;
204 buf->f_files = st.f_files;
205 buf->f_ffree = st.f_ffree;
206 buf->f_fsid[0] = st.f_fsid.val[0];
207 buf->f_fsid[1] = st.f_fsid.val[1];
209 return 0;
212 /* hpux statfs */
213 asmlinkage long hpux_statfs(const char __user *path,
214 struct hpux_statfs __user *buf)
216 struct nameidata nd;
217 int error;
219 error = user_path_walk(path, &nd);
220 if (!error) {
221 struct hpux_statfs tmp;
222 error = vfs_statfs_hpux(nd.dentry, &tmp);
223 if (!error && copy_to_user(buf, &tmp, sizeof(tmp)))
224 error = -EFAULT;
225 path_release(&nd);
227 return error;
230 asmlinkage long hpux_fstatfs(unsigned int fd, struct hpux_statfs __user * buf)
232 struct file *file;
233 struct hpux_statfs tmp;
234 int error;
236 error = -EBADF;
237 file = fget(fd);
238 if (!file)
239 goto out;
240 error = vfs_statfs_hpux(file->f_dentry, &tmp);
241 if (!error && copy_to_user(buf, &tmp, sizeof(tmp)))
242 error = -EFAULT;
243 fput(file);
244 out:
245 return error;
249 /* This function is called from hpux_utssys(); HP-UX implements
250 * uname() as an option to utssys().
252 * The form of this function is pretty much copied from sys_olduname(),
253 * defined in linux/arch/i386/kernel/sys_i386.c.
255 /* TODO: Are these put_user calls OK? Should they pass an int?
256 * (I copied it from sys_i386.c like this.)
258 static int hpux_uname(struct hpux_utsname *name)
260 int error;
262 if (!name)
263 return -EFAULT;
264 if (!access_ok(VERIFY_WRITE,name,sizeof(struct hpux_utsname)))
265 return -EFAULT;
267 down_read(&uts_sem);
269 error = __copy_to_user(&name->sysname,&system_utsname.sysname,HPUX_UTSLEN-1);
270 error |= __put_user(0,name->sysname+HPUX_UTSLEN-1);
271 error |= __copy_to_user(&name->nodename,&system_utsname.nodename,HPUX_UTSLEN-1);
272 error |= __put_user(0,name->nodename+HPUX_UTSLEN-1);
273 error |= __copy_to_user(&name->release,&system_utsname.release,HPUX_UTSLEN-1);
274 error |= __put_user(0,name->release+HPUX_UTSLEN-1);
275 error |= __copy_to_user(&name->version,&system_utsname.version,HPUX_UTSLEN-1);
276 error |= __put_user(0,name->version+HPUX_UTSLEN-1);
277 error |= __copy_to_user(&name->machine,&system_utsname.machine,HPUX_UTSLEN-1);
278 error |= __put_user(0,name->machine+HPUX_UTSLEN-1);
280 up_read(&uts_sem);
282 /* HP-UX utsname has no domainname field. */
284 /* TODO: Implement idnumber!!! */
285 #if 0
286 error |= __put_user(0,name->idnumber);
287 error |= __put_user(0,name->idnumber+HPUX_SNLEN-1);
288 #endif
290 error = error ? -EFAULT : 0;
292 return error;
295 /* Note: HP-UX just uses the old suser() function to check perms
296 * in this system call. We'll use capable(CAP_SYS_ADMIN).
298 int hpux_utssys(char *ubuf, int n, int type)
300 int len;
301 int error;
302 switch( type ) {
303 case 0:
304 /* uname(): */
305 return( hpux_uname( (struct hpux_utsname *)ubuf ) );
306 break ;
307 case 1:
308 /* Obsolete (used to be umask().) */
309 return -EFAULT ;
310 break ;
311 case 2:
312 /* ustat(): */
313 return( hpux_ustat(new_decode_dev(n), (struct hpux_ustat *)ubuf) );
314 break ;
315 case 3:
316 /* setuname():
318 * On linux (unlike HP-UX), utsname.nodename
319 * is the same as the hostname.
321 * sys_sethostname() is defined in linux/kernel/sys.c.
323 if (!capable(CAP_SYS_ADMIN))
324 return -EPERM;
325 /* Unlike Linux, HP-UX returns an error if n==0: */
326 if ( n <= 0 )
327 return -EINVAL ;
328 /* Unlike Linux, HP-UX truncates it if n is too big: */
329 len = (n <= __NEW_UTS_LEN) ? n : __NEW_UTS_LEN ;
330 return( sys_sethostname(ubuf, len) );
331 break ;
332 case 4:
333 /* sethostname():
335 * sys_sethostname() is defined in linux/kernel/sys.c.
337 if (!capable(CAP_SYS_ADMIN))
338 return -EPERM;
339 /* Unlike Linux, HP-UX returns an error if n==0: */
340 if ( n <= 0 )
341 return -EINVAL ;
342 /* Unlike Linux, HP-UX truncates it if n is too big: */
343 len = (n <= __NEW_UTS_LEN) ? n : __NEW_UTS_LEN ;
344 return( sys_sethostname(ubuf, len) );
345 break ;
346 case 5:
347 /* gethostname():
349 * sys_gethostname() is defined in linux/kernel/sys.c.
351 /* Unlike Linux, HP-UX returns an error if n==0: */
352 if ( n <= 0 )
353 return -EINVAL ;
354 return( sys_gethostname(ubuf, n) );
355 break ;
356 case 6:
357 /* Supposedly called from setuname() in libc.
358 * TODO: When and why is this called?
359 * Is it ever even called?
361 * This code should look a lot like sys_sethostname(),
362 * defined in linux/kernel/sys.c. If that gets updated,
363 * update this code similarly.
365 if (!capable(CAP_SYS_ADMIN))
366 return -EPERM;
367 /* Unlike Linux, HP-UX returns an error if n==0: */
368 if ( n <= 0 )
369 return -EINVAL ;
370 /* Unlike Linux, HP-UX truncates it if n is too big: */
371 len = (n <= __NEW_UTS_LEN) ? n : __NEW_UTS_LEN ;
372 /**/
373 /* TODO: print a warning about using this? */
374 down_write(&uts_sem);
375 error = -EFAULT;
376 if (!copy_from_user(system_utsname.sysname, ubuf, len)) {
377 system_utsname.sysname[len] = 0;
378 error = 0;
380 up_write(&uts_sem);
381 return error;
382 break ;
383 case 7:
384 /* Sets utsname.release, if you're allowed.
385 * Undocumented. Used by swinstall to change the
386 * OS version, during OS updates. Yuck!!!
388 * This code should look a lot like sys_sethostname()
389 * in linux/kernel/sys.c. If that gets updated, update
390 * this code similarly.
392 if (!capable(CAP_SYS_ADMIN))
393 return -EPERM;
394 /* Unlike Linux, HP-UX returns an error if n==0: */
395 if ( n <= 0 )
396 return -EINVAL ;
397 /* Unlike Linux, HP-UX truncates it if n is too big: */
398 len = (n <= __NEW_UTS_LEN) ? n : __NEW_UTS_LEN ;
399 /**/
400 /* TODO: print a warning about this? */
401 down_write(&uts_sem);
402 error = -EFAULT;
403 if (!copy_from_user(system_utsname.release, ubuf, len)) {
404 system_utsname.release[len] = 0;
405 error = 0;
407 up_write(&uts_sem);
408 return error;
409 break ;
410 default:
411 /* This system call returns -EFAULT if given an unknown type.
412 * Why not -EINVAL? I don't know, it's just not what they did.
414 return -EFAULT ;
418 int hpux_getdomainname(char *name, int len)
420 int nlen;
421 int err = -EFAULT;
423 down_read(&uts_sem);
425 nlen = strlen(system_utsname.domainname) + 1;
427 if (nlen < len)
428 len = nlen;
429 if(len > __NEW_UTS_LEN)
430 goto done;
431 if(copy_to_user(name, system_utsname.domainname, len))
432 goto done;
433 err = 0;
434 done:
435 up_read(&uts_sem);
436 return err;
440 int hpux_pipe(int *kstack_fildes)
442 int error;
444 lock_kernel();
445 error = do_pipe(kstack_fildes);
446 unlock_kernel();
447 return error;
450 /* lies - says it works, but it really didn't lock anything */
451 int hpux_lockf(int fildes, int function, off_t size)
453 return 0;
456 int hpux_sysfs(int opcode, unsigned long arg1, unsigned long arg2)
458 char *fsname = NULL;
459 int len = 0;
460 int fstype;
462 /*Unimplemented HP-UX syscall emulation. Syscall #334 (sysfs)
463 Args: 1 80057bf4 0 400179f0 0 0 0 */
464 printk(KERN_DEBUG "in hpux_sysfs\n");
465 printk(KERN_DEBUG "hpux_sysfs called with opcode = %d\n", opcode);
466 printk(KERN_DEBUG "hpux_sysfs called with arg1='%lx'\n", arg1);
468 if ( opcode == 1 ) { /* GETFSIND */
469 len = strlen_user((char *)arg1);
470 printk(KERN_DEBUG "len of arg1 = %d\n", len);
471 if (len == 0)
472 return 0;
473 fsname = (char *) kmalloc(len, GFP_KERNEL);
474 if ( !fsname ) {
475 printk(KERN_DEBUG "failed to kmalloc fsname\n");
476 return 0;
479 if ( copy_from_user(fsname, (char *)arg1, len) ) {
480 printk(KERN_DEBUG "failed to copy_from_user fsname\n");
481 kfree(fsname);
482 return 0;
485 /* String could be altered by userspace after strlen_user() */
486 fsname[len] = '\0';
488 printk(KERN_DEBUG "that is '%s' as (char *)\n", fsname);
489 if ( !strcmp(fsname, "hfs") ) {
490 fstype = 0;
491 } else {
492 fstype = 0;
495 kfree(fsname);
497 printk(KERN_DEBUG "returning fstype=%d\n", fstype);
498 return fstype; /* something other than default */
502 return 0;
506 /* Table of syscall names and handle for unimplemented routines */
507 static const char *syscall_names[] = {
508 "nosys", /* 0 */
509 "exit",
510 "fork",
511 "read",
512 "write",
513 "open", /* 5 */
514 "close",
515 "wait",
516 "creat",
517 "link",
518 "unlink", /* 10 */
519 "execv",
520 "chdir",
521 "time",
522 "mknod",
523 "chmod", /* 15 */
524 "chown",
525 "brk",
526 "lchmod",
527 "lseek",
528 "getpid", /* 20 */
529 "mount",
530 "umount",
531 "setuid",
532 "getuid",
533 "stime", /* 25 */
534 "ptrace",
535 "alarm",
536 NULL,
537 "pause",
538 "utime", /* 30 */
539 "stty",
540 "gtty",
541 "access",
542 "nice",
543 "ftime", /* 35 */
544 "sync",
545 "kill",
546 "stat",
547 "setpgrp3",
548 "lstat", /* 40 */
549 "dup",
550 "pipe",
551 "times",
552 "profil",
553 "ki_call", /* 45 */
554 "setgid",
555 "getgid",
556 NULL,
557 NULL,
558 NULL, /* 50 */
559 "acct",
560 "set_userthreadid",
561 NULL,
562 "ioctl",
563 "reboot", /* 55 */
564 "symlink",
565 "utssys",
566 "readlink",
567 "execve",
568 "umask", /* 60 */
569 "chroot",
570 "fcntl",
571 "ulimit",
572 NULL,
573 NULL, /* 65 */
574 "vfork",
575 NULL,
576 NULL,
577 NULL,
578 NULL, /* 70 */
579 "mmap",
580 NULL,
581 "munmap",
582 "mprotect",
583 "madvise", /* 75 */
584 "vhangup",
585 "swapoff",
586 NULL,
587 "getgroups",
588 "setgroups", /* 80 */
589 "getpgrp2",
590 "setpgid/setpgrp2",
591 "setitimer",
592 "wait3",
593 "swapon", /* 85 */
594 "getitimer",
595 NULL,
596 NULL,
597 NULL,
598 "dup2", /* 90 */
599 NULL,
600 "fstat",
601 "select",
602 NULL,
603 "fsync", /* 95 */
604 "setpriority",
605 NULL,
606 NULL,
607 NULL,
608 "getpriority", /* 100 */
609 NULL,
610 NULL,
611 NULL,
612 NULL,
613 NULL, /* 105 */
614 NULL,
615 NULL,
616 "sigvector",
617 "sigblock",
618 "sigsetmask", /* 110 */
619 "sigpause",
620 "sigstack",
621 NULL,
622 NULL,
623 NULL, /* 115 */
624 "gettimeofday",
625 "getrusage",
626 NULL,
627 NULL,
628 "readv", /* 120 */
629 "writev",
630 "settimeofday",
631 "fchown",
632 "fchmod",
633 NULL, /* 125 */
634 "setresuid",
635 "setresgid",
636 "rename",
637 "truncate",
638 "ftruncate", /* 130 */
639 NULL,
640 "sysconf",
641 NULL,
642 NULL,
643 NULL, /* 135 */
644 "mkdir",
645 "rmdir",
646 NULL,
647 "sigcleanup",
648 "setcore", /* 140 */
649 NULL,
650 "gethostid",
651 "sethostid",
652 "getrlimit",
653 "setrlimit", /* 145 */
654 NULL,
655 NULL,
656 "quotactl",
657 "get_sysinfo",
658 NULL, /* 150 */
659 "privgrp",
660 "rtprio",
661 "plock",
662 NULL,
663 "lockf", /* 155 */
664 "semget",
665 NULL,
666 "semop",
667 "msgget",
668 NULL, /* 160 */
669 "msgsnd",
670 "msgrcv",
671 "shmget",
672 NULL,
673 "shmat", /* 165 */
674 "shmdt",
675 NULL,
676 "csp/nsp_init",
677 "cluster",
678 "mkrnod", /* 170 */
679 "test",
680 "unsp_open",
681 NULL,
682 "getcontext",
683 "osetcontext", /* 175 */
684 "bigio",
685 "pipenode",
686 "lsync",
687 "getmachineid",
688 "cnodeid/mysite", /* 180 */
689 "cnodes/sitels",
690 "swapclients",
691 "rmtprocess",
692 "dskless_stats",
693 "sigprocmask", /* 185 */
694 "sigpending",
695 "sigsuspend",
696 "sigaction",
697 NULL,
698 "nfssvc", /* 190 */
699 "getfh",
700 "getdomainname",
701 "setdomainname",
702 "async_daemon",
703 "getdirentries", /* 195 */
704 NULL,
705 NULL,
706 "vfsmount",
707 NULL,
708 "waitpid", /* 200 */
709 NULL,
710 NULL,
711 NULL,
712 NULL,
713 NULL, /* 205 */
714 NULL,
715 NULL,
716 NULL,
717 NULL,
718 NULL, /* 210 */
719 NULL,
720 NULL,
721 NULL,
722 NULL,
723 NULL, /* 215 */
724 NULL,
725 NULL,
726 NULL,
727 NULL,
728 NULL, /* 220 */
729 NULL,
730 NULL,
731 NULL,
732 "sigsetreturn",
733 "sigsetstatemask", /* 225 */
734 "bfactl",
735 "cs",
736 "cds",
737 NULL,
738 "pathconf", /* 230 */
739 "fpathconf",
740 NULL,
741 NULL,
742 "nfs_fcntl",
743 "ogetacl", /* 235 */
744 "ofgetacl",
745 "osetacl",
746 "ofsetacl",
747 "pstat",
748 "getaudid", /* 240 */
749 "setaudid",
750 "getaudproc",
751 "setaudproc",
752 "getevent",
753 "setevent", /* 245 */
754 "audwrite",
755 "audswitch",
756 "audctl",
757 "ogetaccess",
758 "fsctl", /* 250 */
759 "ulconnect",
760 "ulcontrol",
761 "ulcreate",
762 "uldest",
763 "ulrecv", /* 255 */
764 "ulrecvcn",
765 "ulsend",
766 "ulshutdown",
767 "swapfs",
768 "fss", /* 260 */
769 NULL,
770 NULL,
771 NULL,
772 NULL,
773 NULL, /* 265 */
774 NULL,
775 "tsync",
776 "getnumfds",
777 "poll",
778 "getmsg", /* 270 */
779 "putmsg",
780 "fchdir",
781 "getmount_cnt",
782 "getmount_entry",
783 "accept", /* 275 */
784 "bind",
785 "connect",
786 "getpeername",
787 "getsockname",
788 "getsockopt", /* 280 */
789 "listen",
790 "recv",
791 "recvfrom",
792 "recvmsg",
793 "send", /* 285 */
794 "sendmsg",
795 "sendto",
796 "setsockopt",
797 "shutdown",
798 "socket", /* 290 */
799 "socketpair",
800 "proc_open",
801 "proc_close",
802 "proc_send",
803 "proc_recv", /* 295 */
804 "proc_sendrecv",
805 "proc_syscall",
806 "ipccreate",
807 "ipcname",
808 "ipcnamerase", /* 300 */
809 "ipclookup",
810 "ipcselect",
811 "ipcconnect",
812 "ipcrecvcn",
813 "ipcsend", /* 305 */
814 "ipcrecv",
815 "ipcgetnodename",
816 "ipcsetnodename",
817 "ipccontrol",
818 "ipcshutdown", /* 310 */
819 "ipcdest",
820 "semctl",
821 "msgctl",
822 "shmctl",
823 "mpctl", /* 315 */
824 "exportfs",
825 "getpmsg",
826 "putpmsg",
827 "strioctl",
828 "msync", /* 320 */
829 "msleep",
830 "mwakeup",
831 "msem_init",
832 "msem_remove",
833 "adjtime", /* 325 */
834 "kload",
835 "fattach",
836 "fdetach",
837 "serialize",
838 "statvfs", /* 330 */
839 "fstatvfs",
840 "lchown",
841 "getsid",
842 "sysfs",
843 NULL, /* 335 */
844 NULL,
845 "sched_setparam",
846 "sched_getparam",
847 "sched_setscheduler",
848 "sched_getscheduler", /* 340 */
849 "sched_yield",
850 "sched_get_priority_max",
851 "sched_get_priority_min",
852 "sched_rr_get_interval",
853 "clock_settime", /* 345 */
854 "clock_gettime",
855 "clock_getres",
856 "timer_create",
857 "timer_delete",
858 "timer_settime", /* 350 */
859 "timer_gettime",
860 "timer_getoverrun",
861 "nanosleep",
862 "toolbox",
863 NULL, /* 355 */
864 "getdents",
865 "getcontext",
866 "sysinfo",
867 "fcntl64",
868 "ftruncate64", /* 360 */
869 "fstat64",
870 "getdirentries64",
871 "getrlimit64",
872 "lockf64",
873 "lseek64", /* 365 */
874 "lstat64",
875 "mmap64",
876 "setrlimit64",
877 "stat64",
878 "truncate64", /* 370 */
879 "ulimit64",
880 NULL,
881 NULL,
882 NULL,
883 NULL, /* 375 */
884 NULL,
885 NULL,
886 NULL,
887 NULL,
888 "setcontext", /* 380 */
889 "sigaltstack",
890 "waitid",
891 "setpgrp",
892 "recvmsg2",
893 "sendmsg2", /* 385 */
894 "socket2",
895 "socketpair2",
896 "setregid",
897 "lwp_create",
898 "lwp_terminate", /* 390 */
899 "lwp_wait",
900 "lwp_suspend",
901 "lwp_resume",
902 "lwp_self",
903 "lwp_abort_syscall", /* 395 */
904 "lwp_info",
905 "lwp_kill",
906 "ksleep",
907 "kwakeup",
908 "ksleep_abort", /* 400 */
909 "lwp_proc_info",
910 "lwp_exit",
911 "lwp_continue",
912 "getacl",
913 "fgetacl", /* 405 */
914 "setacl",
915 "fsetacl",
916 "getaccess",
917 "lwp_mutex_init",
918 "lwp_mutex_lock_sys", /* 410 */
919 "lwp_mutex_unlock",
920 "lwp_cond_init",
921 "lwp_cond_signal",
922 "lwp_cond_broadcast",
923 "lwp_cond_wait_sys", /* 415 */
924 "lwp_getscheduler",
925 "lwp_setscheduler",
926 "lwp_getprivate",
927 "lwp_setprivate",
928 "lwp_detach", /* 420 */
929 "mlock",
930 "munlock",
931 "mlockall",
932 "munlockall",
933 "shm_open", /* 425 */
934 "shm_unlink",
935 "sigqueue",
936 "sigwaitinfo",
937 "sigtimedwait",
938 "sigwait", /* 430 */
939 "aio_read",
940 "aio_write",
941 "lio_listio",
942 "aio_error",
943 "aio_return", /* 435 */
944 "aio_cancel",
945 "aio_suspend",
946 "aio_fsync",
947 "mq_open",
948 "mq_unlink", /* 440 */
949 "mq_send",
950 "mq_receive",
951 "mq_notify",
952 "mq_setattr",
953 "mq_getattr", /* 445 */
954 "ksem_open",
955 "ksem_unlink",
956 "ksem_close",
957 "ksem_destroy",
958 "lw_sem_incr", /* 450 */
959 "lw_sem_decr",
960 "lw_sem_read",
961 "mq_close",
963 static const int syscall_names_max = 453;
966 hpux_unimplemented(unsigned long arg1,unsigned long arg2,unsigned long arg3,
967 unsigned long arg4,unsigned long arg5,unsigned long arg6,
968 unsigned long arg7,unsigned long sc_num)
970 /* NOTE: sc_num trashes arg8 for the few syscalls that actually
971 * have a valid 8th argument.
973 const char *name = NULL;
974 if ( sc_num <= syscall_names_max && sc_num >= 0 ) {
975 name = syscall_names[sc_num];
978 if ( name ) {
979 printk(KERN_DEBUG "Unimplemented HP-UX syscall emulation. Syscall #%lu (%s)\n",
980 sc_num, name);
981 } else {
982 printk(KERN_DEBUG "Unimplemented unknown HP-UX syscall emulation. Syscall #%lu\n",
983 sc_num);
986 printk(KERN_DEBUG " Args: %lx %lx %lx %lx %lx %lx %lx\n",
987 arg1, arg2, arg3, arg4, arg5, arg6, arg7);
989 return -ENOSYS;