GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / arch / parisc / hpux / sys_hpux.c
blobbd0a8245fb1ef06214262fa708c77e8aacc972fe
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 __user *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 = statfs_by_dentry(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 do_statfs_hpux(struct path *path, struct hpux_statfs *buf)
191 struct kstatfs st;
192 int retval;
194 retval = vfs_statfs(path, &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 *pathname,
214 struct hpux_statfs __user *buf)
216 struct path path;
217 int error;
219 error = user_path(pathname, &path);
220 if (!error) {
221 struct hpux_statfs tmp;
222 error = do_statfs_hpux(&path, &tmp);
223 if (!error && copy_to_user(buf, &tmp, sizeof(tmp)))
224 error = -EFAULT;
225 path_put(&path);
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 = do_statfs_hpux(&file->f_path, &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 __user *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, &utsname()->sysname,
270 HPUX_UTSLEN - 1);
271 error |= __put_user(0, name->sysname + HPUX_UTSLEN - 1);
272 error |= __copy_to_user(&name->nodename, &utsname()->nodename,
273 HPUX_UTSLEN - 1);
274 error |= __put_user(0, name->nodename + HPUX_UTSLEN - 1);
275 error |= __copy_to_user(&name->release, &utsname()->release,
276 HPUX_UTSLEN - 1);
277 error |= __put_user(0, name->release + HPUX_UTSLEN - 1);
278 error |= __copy_to_user(&name->version, &utsname()->version,
279 HPUX_UTSLEN - 1);
280 error |= __put_user(0, name->version + HPUX_UTSLEN - 1);
281 error |= __copy_to_user(&name->machine, &utsname()->machine,
282 HPUX_UTSLEN - 1);
283 error |= __put_user(0, name->machine + HPUX_UTSLEN - 1);
285 up_read(&uts_sem);
287 /* HP-UX utsname has no domainname field. */
289 /* TODO: Implement idnumber!!! */
291 error = error ? -EFAULT : 0;
293 return error;
296 /* Note: HP-UX just uses the old suser() function to check perms
297 * in this system call. We'll use capable(CAP_SYS_ADMIN).
299 int hpux_utssys(char __user *ubuf, int n, int type)
301 int len;
302 int error;
303 switch( type ) {
304 case 0:
305 /* uname(): */
306 return hpux_uname((struct hpux_utsname __user *)ubuf);
307 break ;
308 case 1:
309 /* Obsolete (used to be umask().) */
310 return -EFAULT ;
311 break ;
312 case 2:
313 /* ustat(): */
314 return hpux_ustat(new_decode_dev(n),
315 (struct hpux_ustat __user *)ubuf);
316 break;
317 case 3:
318 /* setuname():
320 * On linux (unlike HP-UX), utsname.nodename
321 * is the same as the hostname.
323 * sys_sethostname() is defined in linux/kernel/sys.c.
325 if (!capable(CAP_SYS_ADMIN))
326 return -EPERM;
327 /* Unlike Linux, HP-UX returns an error if n==0: */
328 if ( n <= 0 )
329 return -EINVAL ;
330 /* Unlike Linux, HP-UX truncates it if n is too big: */
331 len = (n <= __NEW_UTS_LEN) ? n : __NEW_UTS_LEN ;
332 return sys_sethostname(ubuf, len);
333 break ;
334 case 4:
335 /* sethostname():
337 * sys_sethostname() is defined in linux/kernel/sys.c.
339 if (!capable(CAP_SYS_ADMIN))
340 return -EPERM;
341 /* Unlike Linux, HP-UX returns an error if n==0: */
342 if ( n <= 0 )
343 return -EINVAL ;
344 /* Unlike Linux, HP-UX truncates it if n is too big: */
345 len = (n <= __NEW_UTS_LEN) ? n : __NEW_UTS_LEN ;
346 return sys_sethostname(ubuf, len);
347 break ;
348 case 5:
349 /* gethostname():
351 * sys_gethostname() is defined in linux/kernel/sys.c.
353 /* Unlike Linux, HP-UX returns an error if n==0: */
354 if ( n <= 0 )
355 return -EINVAL ;
356 return sys_gethostname(ubuf, n);
357 break ;
358 case 6:
359 /* Supposedly called from setuname() in libc.
360 * TODO: When and why is this called?
361 * Is it ever even called?
363 * This code should look a lot like sys_sethostname(),
364 * defined in linux/kernel/sys.c. If that gets updated,
365 * update this code similarly.
367 if (!capable(CAP_SYS_ADMIN))
368 return -EPERM;
369 /* Unlike Linux, HP-UX returns an error if n==0: */
370 if ( n <= 0 )
371 return -EINVAL ;
372 /* Unlike Linux, HP-UX truncates it if n is too big: */
373 len = (n <= __NEW_UTS_LEN) ? n : __NEW_UTS_LEN ;
374 /**/
375 /* TODO: print a warning about using this? */
376 down_write(&uts_sem);
377 error = -EFAULT;
378 if (!copy_from_user(utsname()->sysname, ubuf, len)) {
379 utsname()->sysname[len] = 0;
380 error = 0;
382 up_write(&uts_sem);
383 return error;
384 break ;
385 case 7:
386 /* Sets utsname.release, if you're allowed.
387 * Undocumented. Used by swinstall to change the
388 * OS version, during OS updates. Yuck!!!
390 * This code should look a lot like sys_sethostname()
391 * in linux/kernel/sys.c. If that gets updated, update
392 * this code similarly.
394 if (!capable(CAP_SYS_ADMIN))
395 return -EPERM;
396 /* Unlike Linux, HP-UX returns an error if n==0: */
397 if ( n <= 0 )
398 return -EINVAL ;
399 /* Unlike Linux, HP-UX truncates it if n is too big: */
400 len = (n <= __NEW_UTS_LEN) ? n : __NEW_UTS_LEN ;
401 /**/
402 /* TODO: print a warning about this? */
403 down_write(&uts_sem);
404 error = -EFAULT;
405 if (!copy_from_user(utsname()->release, ubuf, len)) {
406 utsname()->release[len] = 0;
407 error = 0;
409 up_write(&uts_sem);
410 return error;
411 break ;
412 default:
413 /* This system call returns -EFAULT if given an unknown type.
414 * Why not -EINVAL? I don't know, it's just not what they did.
416 return -EFAULT ;
420 int hpux_getdomainname(char __user *name, int len)
422 int nlen;
423 int err = -EFAULT;
425 down_read(&uts_sem);
427 nlen = strlen(utsname()->domainname) + 1;
429 if (nlen < len)
430 len = nlen;
431 if(len > __NEW_UTS_LEN)
432 goto done;
433 if(copy_to_user(name, utsname()->domainname, len))
434 goto done;
435 err = 0;
436 done:
437 up_read(&uts_sem);
438 return err;
442 int hpux_pipe(int *kstack_fildes)
444 return do_pipe_flags(kstack_fildes, 0);
447 /* lies - says it works, but it really didn't lock anything */
448 int hpux_lockf(int fildes, int function, off_t size)
450 return 0;
453 int hpux_sysfs(int opcode, unsigned long arg1, unsigned long arg2)
455 char *fsname = NULL;
456 int len = 0;
457 int fstype;
459 /*Unimplemented HP-UX syscall emulation. Syscall #334 (sysfs)
460 Args: 1 80057bf4 0 400179f0 0 0 0 */
461 printk(KERN_DEBUG "in hpux_sysfs\n");
462 printk(KERN_DEBUG "hpux_sysfs called with opcode = %d\n", opcode);
463 printk(KERN_DEBUG "hpux_sysfs called with arg1='%lx'\n", arg1);
465 if ( opcode == 1 ) { /* GETFSIND */
466 char __user *user_fsname = (char __user *)arg1;
467 len = strlen_user(user_fsname);
468 printk(KERN_DEBUG "len of arg1 = %d\n", len);
469 if (len == 0)
470 return 0;
471 fsname = kmalloc(len, GFP_KERNEL);
472 if (!fsname) {
473 printk(KERN_DEBUG "failed to kmalloc fsname\n");
474 return 0;
477 if (copy_from_user(fsname, user_fsname, len)) {
478 printk(KERN_DEBUG "failed to copy_from_user fsname\n");
479 kfree(fsname);
480 return 0;
483 /* String could be altered by userspace after strlen_user() */
484 fsname[len] = '\0';
486 printk(KERN_DEBUG "that is '%s' as (char *)\n", fsname);
487 if ( !strcmp(fsname, "hfs") ) {
488 fstype = 0;
489 } else {
490 fstype = 0;
493 kfree(fsname);
495 printk(KERN_DEBUG "returning fstype=%d\n", fstype);
496 return fstype; /* something other than default */
500 return 0;
504 /* Table of syscall names and handle for unimplemented routines */
505 static const char * const syscall_names[] = {
506 "nosys", /* 0 */
507 "exit",
508 "fork",
509 "read",
510 "write",
511 "open", /* 5 */
512 "close",
513 "wait",
514 "creat",
515 "link",
516 "unlink", /* 10 */
517 "execv",
518 "chdir",
519 "time",
520 "mknod",
521 "chmod", /* 15 */
522 "chown",
523 "brk",
524 "lchmod",
525 "lseek",
526 "getpid", /* 20 */
527 "mount",
528 "umount",
529 "setuid",
530 "getuid",
531 "stime", /* 25 */
532 "ptrace",
533 "alarm",
534 NULL,
535 "pause",
536 "utime", /* 30 */
537 "stty",
538 "gtty",
539 "access",
540 "nice",
541 "ftime", /* 35 */
542 "sync",
543 "kill",
544 "stat",
545 "setpgrp3",
546 "lstat", /* 40 */
547 "dup",
548 "pipe",
549 "times",
550 "profil",
551 "ki_call", /* 45 */
552 "setgid",
553 "getgid",
554 NULL,
555 NULL,
556 NULL, /* 50 */
557 "acct",
558 "set_userthreadid",
559 NULL,
560 "ioctl",
561 "reboot", /* 55 */
562 "symlink",
563 "utssys",
564 "readlink",
565 "execve",
566 "umask", /* 60 */
567 "chroot",
568 "fcntl",
569 "ulimit",
570 NULL,
571 NULL, /* 65 */
572 "vfork",
573 NULL,
574 NULL,
575 NULL,
576 NULL, /* 70 */
577 "mmap",
578 NULL,
579 "munmap",
580 "mprotect",
581 "madvise", /* 75 */
582 "vhangup",
583 "swapoff",
584 NULL,
585 "getgroups",
586 "setgroups", /* 80 */
587 "getpgrp2",
588 "setpgid/setpgrp2",
589 "setitimer",
590 "wait3",
591 "swapon", /* 85 */
592 "getitimer",
593 NULL,
594 NULL,
595 NULL,
596 "dup2", /* 90 */
597 NULL,
598 "fstat",
599 "select",
600 NULL,
601 "fsync", /* 95 */
602 "setpriority",
603 NULL,
604 NULL,
605 NULL,
606 "getpriority", /* 100 */
607 NULL,
608 NULL,
609 NULL,
610 NULL,
611 NULL, /* 105 */
612 NULL,
613 NULL,
614 "sigvector",
615 "sigblock",
616 "sigsetmask", /* 110 */
617 "sigpause",
618 "sigstack",
619 NULL,
620 NULL,
621 NULL, /* 115 */
622 "gettimeofday",
623 "getrusage",
624 NULL,
625 NULL,
626 "readv", /* 120 */
627 "writev",
628 "settimeofday",
629 "fchown",
630 "fchmod",
631 NULL, /* 125 */
632 "setresuid",
633 "setresgid",
634 "rename",
635 "truncate",
636 "ftruncate", /* 130 */
637 NULL,
638 "sysconf",
639 NULL,
640 NULL,
641 NULL, /* 135 */
642 "mkdir",
643 "rmdir",
644 NULL,
645 "sigcleanup",
646 "setcore", /* 140 */
647 NULL,
648 "gethostid",
649 "sethostid",
650 "getrlimit",
651 "setrlimit", /* 145 */
652 NULL,
653 NULL,
654 "quotactl",
655 "get_sysinfo",
656 NULL, /* 150 */
657 "privgrp",
658 "rtprio",
659 "plock",
660 NULL,
661 "lockf", /* 155 */
662 "semget",
663 NULL,
664 "semop",
665 "msgget",
666 NULL, /* 160 */
667 "msgsnd",
668 "msgrcv",
669 "shmget",
670 NULL,
671 "shmat", /* 165 */
672 "shmdt",
673 NULL,
674 "csp/nsp_init",
675 "cluster",
676 "mkrnod", /* 170 */
677 "test",
678 "unsp_open",
679 NULL,
680 "getcontext",
681 "osetcontext", /* 175 */
682 "bigio",
683 "pipenode",
684 "lsync",
685 "getmachineid",
686 "cnodeid/mysite", /* 180 */
687 "cnodes/sitels",
688 "swapclients",
689 "rmtprocess",
690 "dskless_stats",
691 "sigprocmask", /* 185 */
692 "sigpending",
693 "sigsuspend",
694 "sigaction",
695 NULL,
696 "nfssvc", /* 190 */
697 "getfh",
698 "getdomainname",
699 "setdomainname",
700 "async_daemon",
701 "getdirentries", /* 195 */
702 NULL,
703 NULL,
704 "vfsmount",
705 NULL,
706 "waitpid", /* 200 */
707 NULL,
708 NULL,
709 NULL,
710 NULL,
711 NULL, /* 205 */
712 NULL,
713 NULL,
714 NULL,
715 NULL,
716 NULL, /* 210 */
717 NULL,
718 NULL,
719 NULL,
720 NULL,
721 NULL, /* 215 */
722 NULL,
723 NULL,
724 NULL,
725 NULL,
726 NULL, /* 220 */
727 NULL,
728 NULL,
729 NULL,
730 "sigsetreturn",
731 "sigsetstatemask", /* 225 */
732 "bfactl",
733 "cs",
734 "cds",
735 NULL,
736 "pathconf", /* 230 */
737 "fpathconf",
738 NULL,
739 NULL,
740 "nfs_fcntl",
741 "ogetacl", /* 235 */
742 "ofgetacl",
743 "osetacl",
744 "ofsetacl",
745 "pstat",
746 "getaudid", /* 240 */
747 "setaudid",
748 "getaudproc",
749 "setaudproc",
750 "getevent",
751 "setevent", /* 245 */
752 "audwrite",
753 "audswitch",
754 "audctl",
755 "ogetaccess",
756 "fsctl", /* 250 */
757 "ulconnect",
758 "ulcontrol",
759 "ulcreate",
760 "uldest",
761 "ulrecv", /* 255 */
762 "ulrecvcn",
763 "ulsend",
764 "ulshutdown",
765 "swapfs",
766 "fss", /* 260 */
767 NULL,
768 NULL,
769 NULL,
770 NULL,
771 NULL, /* 265 */
772 NULL,
773 "tsync",
774 "getnumfds",
775 "poll",
776 "getmsg", /* 270 */
777 "putmsg",
778 "fchdir",
779 "getmount_cnt",
780 "getmount_entry",
781 "accept", /* 275 */
782 "bind",
783 "connect",
784 "getpeername",
785 "getsockname",
786 "getsockopt", /* 280 */
787 "listen",
788 "recv",
789 "recvfrom",
790 "recvmsg",
791 "send", /* 285 */
792 "sendmsg",
793 "sendto",
794 "setsockopt",
795 "shutdown",
796 "socket", /* 290 */
797 "socketpair",
798 "proc_open",
799 "proc_close",
800 "proc_send",
801 "proc_recv", /* 295 */
802 "proc_sendrecv",
803 "proc_syscall",
804 "ipccreate",
805 "ipcname",
806 "ipcnamerase", /* 300 */
807 "ipclookup",
808 "ipcselect",
809 "ipcconnect",
810 "ipcrecvcn",
811 "ipcsend", /* 305 */
812 "ipcrecv",
813 "ipcgetnodename",
814 "ipcsetnodename",
815 "ipccontrol",
816 "ipcshutdown", /* 310 */
817 "ipcdest",
818 "semctl",
819 "msgctl",
820 "shmctl",
821 "mpctl", /* 315 */
822 "exportfs",
823 "getpmsg",
824 "putpmsg",
825 "strioctl",
826 "msync", /* 320 */
827 "msleep",
828 "mwakeup",
829 "msem_init",
830 "msem_remove",
831 "adjtime", /* 325 */
832 "kload",
833 "fattach",
834 "fdetach",
835 "serialize",
836 "statvfs", /* 330 */
837 "fstatvfs",
838 "lchown",
839 "getsid",
840 "sysfs",
841 NULL, /* 335 */
842 NULL,
843 "sched_setparam",
844 "sched_getparam",
845 "sched_setscheduler",
846 "sched_getscheduler", /* 340 */
847 "sched_yield",
848 "sched_get_priority_max",
849 "sched_get_priority_min",
850 "sched_rr_get_interval",
851 "clock_settime", /* 345 */
852 "clock_gettime",
853 "clock_getres",
854 "timer_create",
855 "timer_delete",
856 "timer_settime", /* 350 */
857 "timer_gettime",
858 "timer_getoverrun",
859 "nanosleep",
860 "toolbox",
861 NULL, /* 355 */
862 "getdents",
863 "getcontext",
864 "sysinfo",
865 "fcntl64",
866 "ftruncate64", /* 360 */
867 "fstat64",
868 "getdirentries64",
869 "getrlimit64",
870 "lockf64",
871 "lseek64", /* 365 */
872 "lstat64",
873 "mmap64",
874 "setrlimit64",
875 "stat64",
876 "truncate64", /* 370 */
877 "ulimit64",
878 NULL,
879 NULL,
880 NULL,
881 NULL, /* 375 */
882 NULL,
883 NULL,
884 NULL,
885 NULL,
886 "setcontext", /* 380 */
887 "sigaltstack",
888 "waitid",
889 "setpgrp",
890 "recvmsg2",
891 "sendmsg2", /* 385 */
892 "socket2",
893 "socketpair2",
894 "setregid",
895 "lwp_create",
896 "lwp_terminate", /* 390 */
897 "lwp_wait",
898 "lwp_suspend",
899 "lwp_resume",
900 "lwp_self",
901 "lwp_abort_syscall", /* 395 */
902 "lwp_info",
903 "lwp_kill",
904 "ksleep",
905 "kwakeup",
906 "ksleep_abort", /* 400 */
907 "lwp_proc_info",
908 "lwp_exit",
909 "lwp_continue",
910 "getacl",
911 "fgetacl", /* 405 */
912 "setacl",
913 "fsetacl",
914 "getaccess",
915 "lwp_mutex_init",
916 "lwp_mutex_lock_sys", /* 410 */
917 "lwp_mutex_unlock",
918 "lwp_cond_init",
919 "lwp_cond_signal",
920 "lwp_cond_broadcast",
921 "lwp_cond_wait_sys", /* 415 */
922 "lwp_getscheduler",
923 "lwp_setscheduler",
924 "lwp_getprivate",
925 "lwp_setprivate",
926 "lwp_detach", /* 420 */
927 "mlock",
928 "munlock",
929 "mlockall",
930 "munlockall",
931 "shm_open", /* 425 */
932 "shm_unlink",
933 "sigqueue",
934 "sigwaitinfo",
935 "sigtimedwait",
936 "sigwait", /* 430 */
937 "aio_read",
938 "aio_write",
939 "lio_listio",
940 "aio_error",
941 "aio_return", /* 435 */
942 "aio_cancel",
943 "aio_suspend",
944 "aio_fsync",
945 "mq_open",
946 "mq_unlink", /* 440 */
947 "mq_send",
948 "mq_receive",
949 "mq_notify",
950 "mq_setattr",
951 "mq_getattr", /* 445 */
952 "ksem_open",
953 "ksem_unlink",
954 "ksem_close",
955 "ksem_destroy",
956 "lw_sem_incr", /* 450 */
957 "lw_sem_decr",
958 "lw_sem_read",
959 "mq_close",
961 static const int syscall_names_max = 453;
964 hpux_unimplemented(unsigned long arg1,unsigned long arg2,unsigned long arg3,
965 unsigned long arg4,unsigned long arg5,unsigned long arg6,
966 unsigned long arg7,unsigned long sc_num)
968 /* NOTE: sc_num trashes arg8 for the few syscalls that actually
969 * have a valid 8th argument.
971 const char *name = NULL;
972 if ( sc_num <= syscall_names_max && sc_num >= 0 ) {
973 name = syscall_names[sc_num];
976 if ( name ) {
977 printk(KERN_DEBUG "Unimplemented HP-UX syscall emulation. Syscall #%lu (%s)\n",
978 sc_num, name);
979 } else {
980 printk(KERN_DEBUG "Unimplemented unknown HP-UX syscall emulation. Syscall #%lu\n",
981 sc_num);
984 printk(KERN_DEBUG " Args: %lx %lx %lx %lx %lx %lx %lx\n",
985 arg1, arg2, arg3, arg4, arg5, arg6, arg7);
987 return -ENOSYS;