1 diff -Nru linux-2.6.7/abi/cxenix/Makefile linux-2.6.7-abi/abi/cxenix/Makefile
2 --- linux-2.6.7/abi/cxenix/Makefile 1970-01-01 01:00:00.000000000 +0100
3 +++ linux-2.6.7-abi/abi/cxenix/Makefile 2004-07-22 17:44:20.000000000 +0200
6 +abi-cxenix-objs := sysent.o misc.o stubs.o signal.o pathconf.o utsname.o
8 +obj-$(CONFIG_ABI_SCO) += abi-cxenix.o
10 +abi-cxenix.o: $(abi-cxenix-objs)
11 + $(LD) -r -o $@ $(abi-cxenix-objs)
12 diff -Nru linux-2.6.7/abi/cxenix/misc.c linux-2.6.7-abi/abi/cxenix/misc.c
13 --- linux-2.6.7/abi/cxenix/misc.c 1970-01-01 01:00:00.000000000 +0100
14 +++ linux-2.6.7-abi/abi/cxenix/misc.c 2004-07-22 17:44:20.000000000 +0200
17 + * misc.c - misc cxenix() subcalls
19 + * Copyright (c) 1993,1994 Drew Sullivan
20 + * Copyright (c) 1994-1996 Mike Jagdis
25 +#include <linux/types.h>
26 +#include <linux/module.h>
27 +#include <linux/errno.h>
28 +#include <linux/kernel.h>
29 +#include <linux/unistd.h>
30 +#include <linux/ptrace.h>
31 +#include <linux/fcntl.h>
32 +#include <linux/time.h>
33 +#include <linux/signal.h>
34 +#include <linux/syscalls.h>
35 +#include <linux/termios.h>
36 +#include <asm/uaccess.h>
38 +#include <abi/util/trace.h>
39 +#include <abi/util/sysent.h>
40 +#include <abi/svr4/sigaction.h>
67 + * locking() requires mandatory locking. Processes that attempt to
68 + * read or write a region locked with locking() are required to block.
69 + * You need to build a kernel with mandatory locking support and set
70 + * the permissions on the required file to setgid, no group execute.
73 +xnx_locking(int fd, int mode, unsigned long size)
76 + mm_segment_t old_fs;
79 + if ((mode < 0 || mode > 7) && mode != 20) {
80 +#if defined(CONFIG_ABI_TRACE)
81 + abi_trace(ABI_TRACE_API,
82 + "unsupported locking() mode=0x%x\n", mode);
88 + * Modes 5, 6 & 7 are very like the fcntl mechanism but
89 + * we can't just punt to that because the type values are
92 + if (mode > 4 && mode < 8) {
93 + struct ibcs_flock *ifl = (struct ibcs_flock *)size;
96 + error = verify_area(VERIFY_READ, ifl, sizeof(*ifl));
100 + get_user(t, &ifl->l_type);
102 + case XF_UNLCK: t = F_UNLCK; break;
103 + case XF_WRLCK: t = F_WRLCK; break;
104 + case XF_RDLCK: t = F_RDLCK; break;
105 + default: return -EINVAL;
107 + put_user(t, &ifl->l_type);
109 + error = sys_fcntl(fd, mode, (u_long)ifl);
111 + get_user(t, &ifl->l_type);
113 + case F_UNLCK: t = XF_UNLCK; break;
114 + case F_WRLCK: t = XF_WRLCK; break;
115 + case F_RDLCK: t = XF_RDLCK; break;
117 + put_user(t, &ifl->l_type);
119 + get_user(t, &ifl->l_sysid);
120 + put_user(t, &ifl->l_pid);
121 + put_user(0, &ifl->l_sysid);
125 + fl.l_type = (mode == 0 ? F_UNLCK
126 + : ((mode <= 2 || mode == 20) ? F_WRLCK
134 + error = sys_fcntl(fd, (mode == 5) ? F_GETLK
135 + : (!(mode % 2) ? F_SETLK : F_SETLKW), (u_long)&fl);
141 +/* Check if input is available */
146 + mm_segment_t old_fs;
150 + error = sys_ioctl(fd, FIONREAD, (long)&nbytes);
153 + if (error < 0) return error;
154 + return nbytes ? 1 : 0;
158 + * Linux has a stub sys_ftime. Perhaps this should be there? On the other
159 + * hand it's an old call that probably shouldn't be used by most modern
160 + * applications so perhaps it's better here where it needn't bloat the
164 +xnx_ftime(struct timeb *tp)
167 + struct timezone tz;
169 + mm_segment_t old_fs;
171 + error = verify_area(VERIFY_WRITE, tp, sizeof(struct timeb));
177 + error = sys_gettimeofday(&tv, &tz);
182 + put_user(tv.tv_sec, &tp->time);
183 + put_user((unsigned short)(tv.tv_usec/1000), &tp->millitm);
184 + put_user((short)tz.tz_minuteswest, &tp->timezone);
185 + put_user((short)tz.tz_dsttime, &tp->dstflag);
190 +#define USE_NEW_NAP_CODE
192 +#ifndef USE_NEW_NAP_CODE
193 +static __inline __sighandler_t
194 +sigaction(int sig, __sighandler_t handler)
196 + struct k_sigaction *k = ¤t->sighand->action[sig-1];
197 + __sighandler_t old_handler;
199 + spin_lock(¤t->sighand->siglock);
200 + old_handler = k->sa.sa_handler;
201 + k->sa.sa_handler = handler;
202 + spin_unlock(¤t->sighand->siglock);
204 + return old_handler;
208 +/* go to sleep for period milliseconds */
209 +/* - returns either an EINTR error or returns the elapsed time */
211 + for SCO OpenServer 5.0.6 the original nap was fixed so that it
212 + no longer waits a minimum of 2 tick (20ms)
213 + but fewer time with a 10 ms granularity */
215 +xnx_nap(long period)
217 +#ifdef USE_NEW_NAP_CODE
218 + // Hz means the number of jiffies per second.
219 + // the below code needs HZ to be 1 <= HZ <= 1000
220 + // in order to work correctly in any case.
222 +#error this code only works with HZ <= 1000
224 + struct timeval tv1, tv2;
225 + struct timezone tz;
226 + mm_segment_t oldfs;
227 + long period_s; // seconds part
228 + long period_ms_hz; // milli seconds part, scaled to a base of HZ
229 + long period_j; // jiffies
232 + return 0; // zereo request, zero reply
236 + sys_gettimeofday(&tv1, &tz);
238 + period_s = period / 1000;
239 + period_ms_hz = (period - period_s * 1000) * HZ;
240 + period_j = period_s * HZ + period_ms_hz / 1000;
241 + // take care of rounding errors, round up
242 + if (period > period_j * (1000 / HZ)) period_j++;
244 + set_current_state(TASK_INTERRUPTIBLE);
245 + schedule_timeout (period_j);
247 + sys_gettimeofday(&tv2, &tz);
250 + if (signal_pending(current))
251 + return -EINTR; // interrupted
252 + return (tv2.tv_sec - tv1.tv_sec) * 1000
253 + + (tv2.tv_usec - tv1.tv_usec + 500) / 1000;
255 + __sighandler_t old_handler;
256 + struct itimerval it;
257 + struct timeval tv1, tv2;
258 + struct timezone tz;
259 + mm_segment_t oldfs;
264 + it.it_interval.tv_sec = 0;
265 + it.it_interval.tv_usec = 0;
266 + it.it_value.tv_sec = 0;
267 + it.it_value.tv_usec = period * 1000;
272 + sys_gettimeofday(&tv1, &tz);
273 + old_handler = sigaction(SIGALRM, SIG_DFL); // SIG_DFL -> terminate
274 + sys_setitimer(ITIMER_REAL, &it, NULL);
276 + sigaction(SIGALRM, old_handler);
277 + sys_gettimeofday(&tv2, &tz);
280 + deactivate_signal(current, SIGALRM);
282 + if (signal_pending(current))
284 + return ((tv2.tv_sec - tv1.tv_sec) * 1000000
285 + + (tv2.tv_usec - tv1.tv_usec)) / 1000;
290 + * eaccess() checks access to the given path using the effective
291 + * uid/gid rather than the real uid/gid.
294 +xnx_eaccess(char *path, int mode)
300 + ouid = current->uid;
301 + ogid = current->gid;
302 + current->uid = current->euid;
303 + current->gid = current->egid;
305 + err = sys_access(path, mode);
307 + current->uid = ouid;
308 + current->gid = ogid;
312 diff -Nru linux-2.6.7/abi/cxenix/pathconf.c linux-2.6.7-abi/abi/cxenix/pathconf.c
313 --- linux-2.6.7/abi/cxenix/pathconf.c 1970-01-01 01:00:00.000000000 +0100
314 +++ linux-2.6.7-abi/abi/cxenix/pathconf.c 2004-07-22 17:44:20.000000000 +0200
317 + * pathconf.c - support for xenix pathconf
319 + * Copyright (c) 1993,1994 Drew Sullivan
320 + * Copyright (c) 1994-1996 Mike Jagdis
325 +#include <linux/errno.h>
326 +#include <linux/fs.h>
327 +#include <linux/slab.h>
328 +#include <linux/sched.h>
329 +#include <linux/unistd.h>
330 +#include <linux/syscalls.h>
331 +#include <linux/statfs.h>
332 +#include <asm/uaccess.h>
342 + _PC_CHOWN_RESTRICTED = 6,
348 +xnx_name_max(char *path)
361 + error = sys_statfs(p, &stf);
367 + return (stf.f_namelen);
371 +xnx_pathconf(char *path, int name)
376 + * Although Linux headers define values on a per
377 + * filesystem basis there is no way to access
378 + * these without hard coding fs information here
379 + * so for now we use a bogus value.
382 + case _PC_MAX_CANON:
384 + case _PC_MAX_INPUT:
390 + case _PC_CHOWN_RESTRICTED:
392 + * We should really think about this and tell
397 + /* Not sure... It could be fs dependent? */
402 + return xnx_name_max(path);
408 +xnx_fpathconf(int fildes, int name)
413 + * Although Linux headers define values on a per
414 + * filesystem basis there is no way to access
415 + * these without hard coding fs information here
416 + * so for now we use a bogus value.
419 + case _PC_MAX_CANON:
421 + case _PC_MAX_INPUT:
427 + case _PC_CHOWN_RESTRICTED:
429 + * We should really think about this and tell
434 + /* Not sure... It could be fs dependent? */
442 + mm_segment_t old_fs;
446 + error = sys_fstatfs(fildes, &buf);
449 + return buf.f_namelen;
456 diff -Nru linux-2.6.7/abi/cxenix/signal.c linux-2.6.7-abi/abi/cxenix/signal.c
457 --- linux-2.6.7/abi/cxenix/signal.c 1970-01-01 01:00:00.000000000 +0100
458 +++ linux-2.6.7-abi/abi/cxenix/signal.c 2004-07-22 17:44:20.000000000 +0200
462 +#include <linux/module.h>
463 +#include <linux/kernel.h>
464 +#include <linux/personality.h>
465 +#include <linux/sched.h>
466 +#define __KERNEL_SYSCALLS__
467 +#include <linux/unistd.h>
468 +#include <asm/uaccess.h>
470 +#include <abi/cxenix/signal.h>
471 +#include <abi/signal.h>
473 +#include <abi/util/map.h>
474 +#include <abi/util/sysent.h>
478 +xnx_sigaction(int sco_signum, const struct sco_sigaction *action,
479 + struct sco_sigaction *oldaction)
481 + struct sco_sigaction new_sa, old_sa;
482 + struct sigaction nsa, osa;
486 + if (sco_signum >= NSIGNALS)
488 + signo = current_thread_info()->exec_domain->signal_map[sco_signum];
491 + error = verify_area(VERIFY_WRITE, oldaction,
492 + sizeof(struct sco_sigaction));
498 + error = copy_from_user(&new_sa, action,
499 + sizeof(struct sco_sigaction));
502 + nsa.sa_restorer = NULL;
503 + nsa.sa_handler = new_sa.sa_handler;
504 + nsa.sa_mask = map_sigvec_to_kernel(new_sa.sa_mask,
505 + current_thread_info()->exec_domain->signal_map);
506 + nsa.sa_flags = SA_NOMASK;
507 + if (new_sa.sa_flags & SCO_SA_NOCLDSTOP)
508 + nsa.sa_flags |= SA_NOCLDSTOP;
513 + error = sys_rt_sigaction(signo, action ? &nsa : NULL,
514 + oldaction ? &osa : NULL, sizeof(sigset_t));
517 + if (error || !oldaction)
520 + old_sa.sa_handler = osa.sa_handler;
521 + old_sa.sa_mask = map_sigvec_from_kernel(osa.sa_mask,
522 + current_thread_info()->exec_domain->signal_invmap);
523 + old_sa.sa_flags = 0;
524 + if (osa.sa_flags & SA_NOCLDSTOP)
525 + old_sa.sa_flags |= SCO_SA_NOCLDSTOP;
527 + if (copy_to_user(oldaction, &old_sa, sizeof(struct sco_sigaction)))
533 +xnx_sigpending(u_long *setp)
535 + sigset_t lxpending;
538 + spin_lock_irq(¤t->sighand->siglock);
539 + sigandsets(&lxpending, ¤t->blocked, ¤t->pending.signal);
540 + spin_unlock_irq(¤t->sighand->siglock);
542 + pending = map_sigvec_from_kernel(lxpending,
543 + current_thread_info()->exec_domain->signal_invmap);
545 + if (copy_to_user(setp, &pending, sizeof(u_long)))
549 diff -Nru linux-2.6.7/abi/cxenix/stubs.c linux-2.6.7-abi/abi/cxenix/stubs.c
550 --- linux-2.6.7/abi/cxenix/stubs.c 1970-01-01 01:00:00.000000000 +0100
551 +++ linux-2.6.7-abi/abi/cxenix/stubs.c 2004-07-22 17:44:20.000000000 +0200
554 + * stubs.c - stubs for unimplemented cxenix subcalls
556 + * Copyright (c) 1993,1994 Drew Sullivan.
557 + * Copyright (c) 1994-1996 Mike Jagdis.
562 +#include <linux/errno.h>
563 +#include <linux/types.h>
564 +#include <linux/ptrace.h>
566 +#include <abi/cxenix/sysent.h>
570 +xnx_creatsem(char *sem_name, int mode)
576 +xnx_opensem(char *sem_name)
582 +xnx_sigsem(int sem_num)
588 +xnx_waitsem(int sem_num)
594 +xnx_nbwaitsem(int sem_num)
601 +xnx_sdget(char *path, int flags, long size, int mode)
607 +xnx_sdfree(char* addr)
613 +xnx_sdenter(char *addr, int flags)
619 +xnx_sdleave(char *addr)
625 +xnx_sdgetv(char *addr)
631 +xnx_sdwaitv(char *addr, int vnum)
638 + * This allows processes to be allowed to exceed available swap. The man
639 + * page isn't too clear - it seems to suggest Xenix supports physical
640 + * memory > swap but this doesn't make sense to me? It almost certainly
641 + * isn't useful for Linux to actually do anything with this - just lie.
649 +xnx_proctl(int pid, int command, char *arg)
655 +xnx_execseg(excode_t oldaddr, unsigned size)
662 +xnx_unexecseg(excode_t addr)
668 + * This allows running adb without executing any programs, but disassembly
669 + * will work fine with that lie.
672 +xnx_paccess(int pid, int cmd, int offset, int count, char *ptr)
676 diff -Nru linux-2.6.7/abi/cxenix/sysent.c linux-2.6.7-abi/abi/cxenix/sysent.c
677 --- linux-2.6.7/abi/cxenix/sysent.c 1970-01-01 01:00:00.000000000 +0100
678 +++ linux-2.6.7-abi/abi/cxenix/sysent.c 2004-07-22 17:44:20.000000000 +0200
682 +#include <linux/module.h>
683 +#include <linux/kernel.h>
684 +#include <linux/personality.h>
685 +#include <linux/sched.h>
686 +#include <linux/ptrace.h>
687 +#include <linux/syscalls.h>
688 +#include <asm/uaccess.h>
690 +#include <abi/svr4/sysent.h>
691 +#include <abi/cxenix/sysent.h>
693 +#include <abi/util/errno.h>
694 +#include <abi/util/sysent.h>
697 +MODULE_DESCRIPTION("Xenix/OpenServer cxenix call support");
698 +MODULE_AUTHOR("Christoph Hellwig, partially taken from iBCS");
699 +MODULE_LICENSE("GPL");
702 +static struct sysent cxenix_table[] = {
703 +/* 0 */ { 0, Ukn, "syscall", "" },
704 +/* 1 */ { xnx_locking, 3, "locking", "ddd" },
705 +/* 2 */ { xnx_creatsem, 2, "creatsem", "sd" },
706 +/* 3 */ { xnx_opensem, 1, "opensem", "s" },
707 +/* 4 */ { xnx_sigsem, 1, "sigsem", "d" },
708 +/* 5 */ { xnx_waitsem, 1, "waitsem", "d" },
709 +/* 6 */ { xnx_nbwaitsem, 1, "nbwaitsem", "d" },
710 +/* 7 */ { xnx_rdchk, 1, "rdchk", "d" },
711 +/* 8 */ { 0, Ukn, "stkgro", "" },
712 +/* 9 */ { 0, Ukn, "?", "" },
713 +/* 10 */ { sys_ftruncate, 2, "chsize", "dd" },
714 +/* 11 */ { xnx_ftime, 1, "ftime", "x" },
715 +/* 12 */ { xnx_nap, 1, "nap", "d" },
716 +/* 13 */ { xnx_sdget, 4, "sdget", "sddd" },
717 +/* 14 */ { xnx_sdfree, 1, "sdfree", "x" },
718 +/* 15 */ { xnx_sdenter, 2, "sdenter", "xd" },
719 +/* 16 */ { xnx_sdleave, 1, "sdleave", "x" },
720 +/* 17 */ { xnx_sdgetv, 1, "sdgetv", "x" },
721 +/* 18 */ { xnx_sdwaitv, 2, "sdwaitv", "xd" },
722 +/* 19 */ { 0, Ukn, "brkctl", "" },
723 +/* 20 */ { 0, Ukn, "?", "" },
724 +/* 21 */ { 0, 2, "sco-getcwd?", "dx" },
725 +/* 22 */ { 0, Ukn, "?", "" },
726 +/* 23 */ { 0, Ukn, "?", "" },
727 +/* 24 */ { 0, Ukn, "?", "" },
728 +/* 25 */ { 0, Ukn, "?", "" },
729 +/* 26 */ { 0, Ukn, "?", "" },
730 +/* 27 */ { 0, Ukn, "?", "" },
731 +/* 28 */ { 0, Ukn, "?", "" },
732 +/* 29 */ { 0, Ukn, "?", "" },
733 +/* 30 */ { 0, Ukn, "?", "" },
734 +/* 31 */ { 0, Ukn, "?", "" },
735 +/* 32 */ { xnx_proctl, 3, "proctl", "ddx" },
736 +/* 33 */ { xnx_execseg, 2, "execseg", "xd" },
737 +/* 34 */ { xnx_unexecseg, 1, "unexecseg", "x" },
738 +/* 35 */ { 0, Ukn, "?", "" },
739 +/* 36 */ { sys_select, 5, "select", "dxxxx" },
740 +/* 37 */ { xnx_eaccess, 2, "eaccess", "so" },
741 +/* 38 */ { xnx_paccess, 5, "paccess", "dddds" },
742 +/* 39 */ { xnx_sigaction, 3, "sigaction", "dxx" },
743 +/* 40 */ { abi_sigprocmask, 3, "sigprocmask", "dxx" },
744 +/* 41 */ { xnx_sigpending, 1, "sigpending", "x" },
745 +/* 42 */ { abi_sigsuspend, Spl, "sigsuspend", "x" },
746 +/* 43 */ { sys_getgroups16, 2, "getgroups", "dx" },
747 +/* 44 */ { sys_setgroups16, 2, "setgroups", "dx" },
748 +/* 45 */ { ibcs_sysconf, 1, "sysconf", "d" },
749 +/* 46 */ { xnx_pathconf, 2, "pathconf", "sd" },
750 +/* 47 */ { xnx_fpathconf, 2, "fpathconf", "dd" },
751 +/* 48 */ { sys_rename, 2, "rename", "ss" },
752 +/* 49 */ { 0, Ukn, "?", "" },
753 +/* 50 */ { xnx_utsname, 1, "utsname", "x" },
754 +/* 51 */ { 0, Ukn, "?", "" },
755 +/* 52 */ { 0, Ukn, "?", "" },
756 +/* 53 */ { 0, Ukn, "?", "" },
757 +/* 54 */ { 0, Ukn, "?", "" },
758 +/* 55 */ { sys_getitimer, 2, "getitimer", "dx" },
759 +/* 56 */ { sys_setitimer, 3, "setitimer", "dxx" }
763 +void cxenix(struct pt_regs *regs)
765 + int sysno = regs->eax >> 8;
767 + if (sysno >= ARRAY_SIZE(cxenix_table))
768 + set_error(regs, iABI_errors(-EINVAL));
770 + lcall7_dispatch(regs, &cxenix_table[sysno], 1);
773 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
774 +EXPORT_SYMBOL(cxenix);
776 diff -Nru linux-2.6.7/abi/cxenix/utsname.c linux-2.6.7-abi/abi/cxenix/utsname.c
777 --- linux-2.6.7/abi/cxenix/utsname.c 1970-01-01 01:00:00.000000000 +0100
778 +++ linux-2.6.7-abi/abi/cxenix/utsname.c 2004-07-22 17:44:20.000000000 +0200
781 + * utsname.c - support for the utsname subcall of cxenix
783 + * Copyright (C) 1994 Mike Jagdis (jaggy@purplet.demon.co.uk)
788 +#include <linux/mm.h>
789 +#include <linux/sched.h>
790 +#include <linux/personality.h>
791 +#include <linux/utsname.h>
792 +#include <linux/eisa.h>
793 +#include <asm/uaccess.h>
796 +static char sco_serial[10] = "public";
798 +struct xnx_utsname {
805 + char sysserial[10];
812 +#define set_utsfield(to, from, dotchop) \
815 + int i, len = (sizeof(to) > sizeof(from) ? sizeof(from) : sizeof(to)); \
816 + __copy_to_user(to, from, len); \
818 + for (p=from,i=0; *p && *p != '.' && --len; p++,i++); \
821 + __put_user('\0', to+i); \
826 +xnx_utsname(u_long addr)
828 + struct xnx_utsname *utp = (struct xnx_utsname *)addr;
832 + * This shouldn't be invoked by anything that isn't running
833 + * in the SCO personality. I can envisage a program that uses
834 + * this to test if utp is running on SCO or not. It probably
835 + * won't happen but let's make sure utp doesn't anyway...
837 + if (!is_cur_personality(PER_SCOSVR3))
840 + down_read(&uts_sem);
841 + error = verify_area(VERIFY_WRITE, utp, sizeof (struct xnx_utsname));
843 + if (abi_fake_utsname) {
844 + set_utsfield(utp->sysname, "SCO_SV", 0);
845 + set_utsfield(utp->nodename, system_utsname.nodename, 1);
846 + set_utsfield(utp->release, "3.2v5.0.0\0", 0);
848 + set_utsfield(utp->sysname, system_utsname.nodename, 1);
849 + set_utsfield(utp->nodename, system_utsname.nodename, 1);
850 + set_utsfield(utp->release, system_utsname.release, 0);
852 + set_utsfield(utp->kernelid, system_utsname.version, 0);
853 + set_utsfield(utp->machine, system_utsname.machine, 0);
855 + set_utsfield(utp->bustype, "EISA", 0);
857 + set_utsfield(utp->bustype, "ISA", 0);
859 + set_utsfield(utp->sysserial, sco_serial, 0);
860 + __put_user(0xffff, &utp->sysorigin);
861 + __put_user(0xffff, &utp->sysoem);
862 + set_utsfield(utp->numusers, "unlim", 0);
863 + __put_user(1, &utp->numcpu);
869 diff -Nru linux-2.6.7/abi/ibcs/Makefile linux-2.6.7-abi/abi/ibcs/Makefile
870 --- linux-2.6.7/abi/ibcs/Makefile 1970-01-01 01:00:00.000000000 +0100
871 +++ linux-2.6.7-abi/abi/ibcs/Makefile 2004-07-22 17:44:20.000000000 +0200
874 +abi-ibcs-objs := sysent.o
876 +obj-$(CONFIG_ABI_IBCS) += abi-ibcs.o
878 +abi-ibcs.o: $(abi-ibcs-objs)
879 + $(LD) -r -o $@ $(abi-ibcs-objs)
880 diff -Nru linux-2.6.7/abi/ibcs/sysent.c linux-2.6.7-abi/abi/ibcs/sysent.c
881 --- linux-2.6.7/abi/ibcs/sysent.c 1970-01-01 01:00:00.000000000 +0100
882 +++ linux-2.6.7-abi/abi/ibcs/sysent.c 2004-07-22 17:44:20.000000000 +0200
885 + * Copyright (c) 2001 Christoph Hellwig.
886 + * All rights reserved.
888 + * This program is free software; you can redistribute it and/or modify
889 + * it under the terms of the GNU General Public License as published by
890 + * the Free Software Foundation; either version 2 of the License, or
891 + * (at your option) any later version.
893 + * This program is distributed in the hope that it will be useful,
894 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
895 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
896 + * GNU General Public License for more details.
898 + * You should have received a copy of the GNU General Public License
899 + * along with this program; if not, write to the Free Software
900 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
906 + * SVR4 personality switch.
908 +#include <linux/config.h>
909 +#include <linux/kernel.h>
910 +#include <linux/module.h>
911 +#include <linux/init.h>
912 +#include <linux/personality.h>
913 +#include <linux/syscalls.h>
914 +#include <linux/socket.h>
915 +#include <linux/highuid.h>
916 +#include <linux/net.h>
917 +#include <asm/uaccess.h>
919 +#include <abi/svr4/sysent.h>
920 +#include <abi/signal.h>
922 +#include <abi/util/errno.h>
923 +#include <abi/util/sysent.h>
924 +#include <abi/util/socket.h>
926 +MODULE_DESCRIPTION("iBCS2/iABI4 personality");
927 +MODULE_AUTHOR("Christoph Hellwig, partially taken from iBCS");
928 +MODULE_LICENSE("GPL");
932 + * We could remove some of the long identity mapped runs but at the
933 + * expense of extra comparisons for each mapping at run time...
935 +static u_char ibcs_err_table[] = {
936 +/* 0 - 9 */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
937 +/* 10 - 19 */ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
938 +/* 20 - 29 */ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
939 +/* 30 - 39 */ 30, 31, 32, 33, 34, 45, 78, 46, 89, 93,
940 +/* 40 - 49 */ 90, 90, 35, 36, 37, 38, 39, 40, 41, 42,
941 +/* 50 - 59 */ 43, 44, 50, 51, 52, 53, 54, 55, 56, 57,
942 +/* 60 - 69 */ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
943 +/* 70 - 79 */ 70, 71, 74, 76, 77, 79, 80, 81, 82, 83,
944 +/* 80 - 89 */ 84, 85, 86, 87, 88, 91, 92, 94, 95, 96,
945 +/* 90 - 99 */ 97, 98, 99, 120, 121, 122, 123, 124, 125, 126,
946 +/* 100 - 109 */ 127, 128, 129, 130, 131, 132, 133, 134, 143, 144,
947 +/* 110 - 119 */ 145, 146, 147, 148, 149, 150, 22, 135, 137, 138,
948 +/* 120 - 122 */ 139, 140, 28
952 + * Map Linux RESTART* values (512,513,514) to EINTR
954 +static u_char lnx_err_table[] = {
955 +/* 512 - 514 */ EINTR, EINTR, EINTR
958 +struct map_segment ibcs_err_map[] = {
959 + { 0, 0+sizeof(ibcs_err_table)-1, ibcs_err_table },
960 + { 512, 512+sizeof(lnx_err_table)-1, lnx_err_table },
964 +static long linux_to_ibcs_signals[NSIGNALS+1] = {
965 +/* 0 - 3 */ 0, IBCS_SIGHUP, IBCS_SIGINT, IBCS_SIGQUIT,
966 +/* 4 - 7 */ IBCS_SIGILL, IBCS_SIGTRAP, IBCS_SIGABRT, -1,
967 +/* 8 - 11 */ IBCS_SIGFPE, IBCS_SIGKILL, IBCS_SIGUSR1, IBCS_SIGSEGV,
968 +/* 12 - 15 */ IBCS_SIGUSR2, IBCS_SIGPIPE, IBCS_SIGALRM, IBCS_SIGTERM,
969 +/* 16 - 19 */ IBCS_SIGSEGV, IBCS_SIGCHLD, IBCS_SIGCONT, IBCS_SIGSTOP,
970 +/* 20 - 23 */ IBCS_SIGTSTP, IBCS_SIGTTIN, IBCS_SIGTTOU, IBCS_SIGURG,
971 +/* 24 - 27 */ IBCS_SIGGXCPU, IBCS_SIGGXFSZ, IBCS_SIGVTALRM, IBCS_SIGPROF,
972 +/* 28 - 31 */ IBCS_SIGWINCH, IBCS_SIGIO, IBCS_SIGPWR, -1,
976 +static long ibcs_to_linux_signals[NSIGNALS+1] = {
977 +/* 0 - 3 */ 0, SIGHUP, SIGINT, SIGQUIT,
978 +/* 4 - 7 */ SIGILL, SIGTRAP, SIGIOT, SIGUNUSED,
979 +/* 8 - 11 */ SIGFPE, SIGKILL, SIGUNUSED, SIGSEGV,
980 +/* 12 - 15 */ SIGUNUSED, SIGPIPE, SIGALRM, SIGTERM,
981 +/* 16 - 19 */ SIGUSR1, SIGUSR2, SIGCHLD, SIGPWR,
982 +/* 20 - 23 */ SIGWINCH, SIGURG, SIGPOLL, SIGSTOP,
983 +/* 24 - 27 */ SIGTSTP, SIGCONT, SIGTTIN, SIGTTOU,
984 +/* 28 - 31 */ SIGVTALRM, SIGPROF, SIGXCPU, SIGXFSZ,
988 +static char ibcs_socktype[] = {
997 +static struct map_segment ibcs_socktype_map[] = {
998 + { 1, 6, ibcs_socktype },
1002 +static struct map_segment ibcs_sockopt_map[] = {
1003 + { 0x0001, 0x0001, (char *)SO_DEBUG },
1004 + { 0x0002, 0x0002, (char *)__SO_ACCEPTCON },
1005 + { 0x0004, 0x0004, (char *)SO_REUSEADDR },
1006 + { 0x0008, 0x0008, (char *)SO_KEEPALIVE },
1007 + { 0x0010, 0x0010, (char *)SO_DONTROUTE },
1008 + { 0x0020, 0x0020, (char *)SO_BROADCAST },
1009 + { 0x0040, 0x0040, (char *)SO_USELOOPBACK },
1010 + { 0x0080, 0x0080, (char *)SO_LINGER },
1011 + { 0x0100, 0x0100, (char *)SO_OOBINLINE },
1012 + { 0x0200, 0x0200, (char *)SO_ORDREL },
1013 + { 0x0400, 0x0400, (char *)SO_IMASOCKET },
1014 + { 0x1001, 0x1001, (char *)SO_SNDBUF },
1015 + { 0x1002, 0x1002, (char *)SO_RCVBUF },
1016 + { 0x1003, 0x1003, (char *)SO_SNDLOWAT },
1017 + { 0x1004, 0x1004, (char *)SO_RCVLOWAT },
1018 + { 0x1005, 0x1005, (char *)SO_SNDTIMEO },
1019 + { 0x1006, 0x1006, (char *)SO_RCVTIMEO },
1020 + { 0x1007, 0x1007, (char *)SO_ERROR },
1021 + { 0x1008, 0x1008, (char *)SO_TYPE },
1022 + { 0x1009, 0x1009, (char *)SO_PROTOTYPE },
1026 +static struct map_segment ibcs_af_map[] = {
1032 +static struct sysent ibcs_syscall_table[] = {
1033 + { abi_syscall, Fast, "syscall", "" }, /* 0 */
1034 + { sys_exit, 1, "exit", "d" }, /* 1 */
1035 + { abi_fork, Spl, "fork", "" }, /* 2 */
1036 + { abi_read, 3, "read", "dpd" }, /* 3 */
1037 + { sys_write, 3, "write", "dpd" }, /* 4 */
1038 + { svr4_open, 3, "open", "soo" }, /* 5 */
1039 + { sys_close, 1, "close", "d" }, /* 6 */
1040 + { abi_wait, Spl, "wait", "xxx" }, /* 7 */
1041 + { sys_creat, 2, "creat", "so" }, /* 8 */
1042 + { sys_link, 2, "link", "ss" }, /* 9 */
1043 + { sys_unlink, 1, "unlink", "s" }, /* 10 */
1044 + { abi_exec, Spl, "exec", "sxx" }, /* 11 */
1045 + { sys_chdir, 1, "chdir", "s" }, /* 12 */
1046 + { abi_time, 0, "time", "" }, /* 13 */
1047 + { svr4_mknod, 3, "mknod", "soo" }, /* 14 */
1048 + { sys_chmod, 2, "chmod", "so" }, /* 15 */
1049 + { sys_chown, 3, "chown", "sdd" }, /* 16 */
1050 + { abi_brk, 1, "brk/break", "x" }, /* 17 */
1051 + { svr4_stat, 2, "stat", "sp" }, /* 18 */
1052 + { sys_lseek, 3, "seek/lseek", "ddd" }, /* 19 */
1053 + { abi_getpid, Spl, "getpid", "" }, /* 20 */
1054 + { 0, Ukn, "mount", "" }, /* 21 */
1055 + { sys_umount, 1, "umount", "s" }, /* 22 */
1056 + { sys_setuid, 1, "setuid", "d" }, /* 23 */
1057 + { abi_getuid, Spl, "getuid", "" }, /* 24 */
1058 + { sys_stime, 1, "stime", "d" }, /* 25 */
1059 + { 0, Ukn, "ptrace", "" }, /* 26 */
1060 + { sys_alarm, 1, "alarm", "d" }, /* 27 */
1061 + { svr4_fstat, 2, "fstat", "dp" }, /* 28 */
1062 + { sys_pause, 0, "pause", "" }, /* 29 */
1063 + { sys_utime, 2, "utime", "xx" }, /* 30 */
1064 + { 0, Ukn, "stty", "" }, /* 31 */
1065 + { 0, Ukn, "gtty", "" }, /* 32 */
1066 + { sys_access, 2, "access", "so" }, /* 33 */
1067 + { sys_nice, 1, "nice", "d" }, /* 34 */
1068 + { svr4_statfs, 4, "statfs", "spdd" }, /* 35 */
1069 + { sys_sync, 0, "sync", "" }, /* 36 */
1070 + { abi_kill, 2, "kill", "dd" }, /* 37 */
1071 + { svr4_fstatfs, 4, "fstatfs", "dpdd" }, /* 38 */
1072 + { abi_procids, Spl, "procids", "d" }, /* 39 */
1073 + { 0, Ukn, "cxenix", "" }, /* 40 */
1074 + { sys_dup, 1, "dup", "d" }, /* 41 */
1075 + { abi_pipe, Spl, "pipe", "" }, /* 42 */
1076 + { sys_times, 1, "times", "p" }, /* 43 */
1077 + { 0, Ukn, "prof", "" }, /* 44 */
1078 + { 0, Ukn, "lock/plock", "" }, /* 45 */
1079 + { sys_setgid, 1, "setgid", "d" }, /* 46 */
1080 + { abi_getgid, Spl, "getgid", "" }, /* 47 */
1081 + { abi_sigfunc, Fast, "sigfunc", "xxx" }, /* 48 */
1082 + { svr4_msgsys, Spl, "msgsys", "dxddd" }, /* 49 */
1083 + { svr4_sysi86, 3, "sysi86", "d" }, /* 50 */
1084 + { sys_acct, 1, "acct/sysacct", "x" }, /* 51 */
1085 + { svr4_shmsys, Fast, "shmsys", "ddxo" }, /* 52 */
1086 + { svr4_semsys, Spl, "semsys", "dddx" }, /* 53 */
1087 + { svr4_ioctl, Spl, "ioctl", "dxx" }, /* 54 */
1088 + { 0, 3, "uadmin", "xxx" }, /* 55 */
1089 + { 0, Ukn, "?", "" }, /* 56 */
1090 + { v7_utsname, 1, "utsys", "x" }, /* 57 */
1091 + { sys_fsync, 1, "fsync", "d" }, /* 58 */
1092 + { abi_exec, Spl, "execv", "spp" }, /* 59 */
1093 + { sys_umask, 1, "umask", "o" }, /* 60 */
1094 + { sys_chroot, 1, "chroot", "s" }, /* 61 */
1095 + { svr4_fcntl, 3, "fcntl", "dxx" }, /* 62 */
1096 + { svr4_ulimit, 2, "ulimit", "xx" }, /* 63 */
1097 + { 0, Ukn, "?", "" }, /* 64 */
1098 + { 0, Ukn, "?", "" }, /* 65 */
1099 + { 0, Ukn, "?", "" }, /* 66 */
1100 + { 0, Ukn, "?", "" }, /* 67 */
1101 + { 0, Ukn, "?", "" }, /* 68 */
1102 + { 0, Ukn, "?", "" }, /* 69 */
1103 + { 0, Ukn, "advfs", "" }, /* 70 */
1104 + { 0, Ukn, "unadvfs", "" }, /* 71 */
1105 + { 0, Ukn, "rmount", "" }, /* 72 */
1106 + { 0, Ukn, "rumount", "" }, /* 73 */
1107 + { 0, Ukn, "rfstart", "" }, /* 74 */
1108 + { 0, Ukn, "?", "" }, /* 75 */
1109 + { 0, Ukn, "rdebug", "" }, /* 76 */
1110 + { 0, Ukn, "rfstop", "" }, /* 77 */
1111 + { 0, Ukn, "rfsys", "" }, /* 78 */
1112 + { sys_rmdir, 1, "rmdir", "s" }, /* 79 */
1113 + { abi_mkdir, 2, "mkdir", "so" }, /* 80 */
1114 + { svr4_getdents, 3, "getdents", "dxd" }, /* 81 */
1115 + { 0, Ukn, "libattach", "" }, /* 82 */
1116 + { 0, Ukn, "libdetach", "" }, /* 83 */
1117 + { svr4_sysfs, 3, "sysfs", "dxx" }, /* 84 */
1118 + { svr4_getmsg, Spl, "getmsg", "dxxx" }, /* 85 */
1119 + { svr4_putmsg, Spl, "putmsg", "dxxd" }, /* 86 */
1120 + { sys_poll, 3, "poll", "xdd" }, /* 87 */
1121 + { svr4_lstat, 2, "lstat", "sp" }, /* 88 */
1122 + { sys_symlink, 2, "symlink", "ss" }, /* 89 */
1123 + { sys_readlink, 3, "readlink", "spd" }, /* 90 */
1124 + { sys_setgroups, 2, "setgroups", "dp" }, /* 91 */
1125 + { sys_getgroups, 2, "getgroups", "dp" }, /* 92 */
1126 + { sys_fchmod, 2, "fchmod", "do" }, /* 93 */
1127 + { sys_fchown, 3, "fchown", "ddd" }, /* 94 */
1128 + { abi_sigprocmask, 3, "sigprocmask", "dxx" }, /* 95 */
1129 + { abi_sigsuspend, Spl, "sigsuspend", "x" }, /* 96 */
1130 + { 0, 2, "sigaltstack", "xx" }, /* 97 */
1131 + { abi_sigaction, 3, "sigaction", "dxx" }, /* 98 */
1132 + { svr4_sigpending, 2, "sigpending", "dp" }, /* 99 */
1133 + { svr4_context, Spl, "context", "" }, /* 100 */
1134 + { 0, Ukn, "evsys", "" }, /* 101 */
1135 + { 0, Ukn, "evtrapret", "" }, /* 102 */
1136 + { svr4_statvfs, 2, "statvfs", "sp" }, /* 103 */
1137 + { svr4_fstatvfs, 2, "fstatvfs", "dp" }, /* 104 */
1138 + { 0, Ukn, "sysisc", "" }, /* 105 */
1139 + { 0, Ukn, "nfssys", "" }, /* 106 */
1140 + { 0, 4, "waitid", "ddxd" }, /* 107 */
1141 + { 0, 3, "sigsendsys", "ddd" }, /* 108 */
1142 + { svr4_hrtsys, Spl, "hrtsys", "xxx" }, /* 109 */
1143 + { 0, 3, "acancel", "dxd" }, /* 110 */
1144 + { 0, Ukn, "async", "" }, /* 111 */
1145 + { 0, Ukn, "priocntlsys", "" }, /* 112 */
1146 + { svr4_pathconf, 2, "pathconf", "sd" }, /* 113 */
1147 + { 0, 3, "mincore", "xdx" }, /* 114 */
1148 + { svr4_mmap, 6, "mmap", "xxxxdx"},/* 115 */
1149 + { sys_mprotect, 3, "mprotect", "xdx" },/* 116 */
1150 + { sys_munmap, 2, "munmap", "xd" },/* 117 */
1151 + { svr4_fpathconf, 2, "fpathconf", "dd" }, /* 118 */
1152 + { abi_fork, Spl, "vfork", "" }, /* 119 */
1153 + { sys_fchdir, 1, "fchdir", "d" }, /* 120 */
1154 + { sys_readv, 3, "readv", "dxd" }, /* 121 */
1155 + { sys_writev, 3, "writev", "dxd" }, /* 122 */
1156 + { svr4_xstat, 3, "xstat", "dsx" }, /* 123 */
1157 + { svr4_lxstat, 3, "lxstat", "dsx" }, /* 124 */
1158 + { svr4_fxstat, 3, "fxstat", "ddx" }, /* 125 */
1159 + { svr4_xmknod, 4, "xmknod", "dsox" }, /* 126 */
1160 + { 0, Ukn, "syslocal", "d" }, /* 127 */
1161 + { svr4_getrlimit, 2, "setrlimit", "dx" }, /* 128 */
1162 + { svr4_setrlimit, 2, "getrlimit", "dx" }, /* 129 */
1163 + { 0, 3, "lchown", "sdd" }, /* 130 */
1164 + { 0, Ukn, "memcntl", "" }, /* 131 */
1165 +#if defined(CONFIG_ABI_XTI)
1166 + { svr4_getpmsg, 5, "getpmsg", "dxxxx" }, /* 132 */
1167 + { svr4_putpmsg, 5, "putpmsg", "dxxdd" }, /* 133 */
1169 + { 0, 5, "getpmsg", "dxxxx" }, /* 132 */
1170 + { 0, 5, "putpmsg", "dxxdd" }, /* 133 */
1172 + { sys_rename, 2, "rename", "ss" }, /* 134 */
1173 + { abi_utsname, 1, "uname", "x" }, /* 135 */
1174 + { svr4_setegid, 1, "setegid", "d" }, /* 136 */
1175 + { svr4_sysconfig, 1, "sysconfig", "d" }, /* 137 */
1176 + { 0, Ukn, "adjtime", "" }, /* 138 */
1177 + { svr4_sysinfo, 3, "systeminfo", "dsd" }, /* 139 */
1178 + { socksys_syscall, 1, "socksys", "x" }, /* 140 */
1179 + { svr4_seteuid, 1, "seteuid", "d" }, /* 141 */
1180 + { 0, Ukn, "?", "" }, /* 142 */
1181 + { 0, Ukn, "?", "" }, /* 143 */
1182 + { 0, 2, "secsys", "dx" }, /* 144 */
1183 + { 0, 4, "filepriv", "sdxd" }, /* 145 */
1184 + { 0, 3, "procpriv", "dxd" }, /* 146 */
1185 + { 0, 3, "devstat", "sdx" }, /* 147 */
1186 + { 0, 5, "aclipc", "ddddx" }, /* 148 */
1187 + { 0, 3, "fdevstat", "ddx" }, /* 149 */
1188 + { 0, 3, "flvlfile", "ddx" }, /* 150 */
1189 + { 0, 3, "lvlfile", "sdx" }, /* 151 */
1190 + { 0, Ukn, "?", "" }, /* 152 */
1191 + { 0, 2, "lvlequal", "xx" }, /* 153 */
1192 + { 0, 2, "lvlproc", "dx" }, /* 154 */
1193 + { 0, Ukn, "?", "" }, /* 155 */
1194 + { 0, 4, "lvlipc", "dddx" }, /* 156 */
1195 + { 0, 4, "acl", "sddx" }, /* 157 */
1196 + { 0, Ukn, "auditevt", "" }, /* 158 */
1197 + { 0, Ukn, "auditctl", "" }, /* 159 */
1198 + { 0, Ukn, "auditdmp", "" }, /* 160 */
1199 + { 0, Ukn, "auditlog", "" }, /* 161 */
1200 + { 0, Ukn, "auditbuf", "" }, /* 162 */
1201 + { 0, 2, "lvldom", "xx" }, /* 163 */
1202 + { 0, Ukn, "lvlvfs", "" }, /* 164 */
1203 + { 0, 2, "mkmld", "so" }, /* 165 */
1204 + { 0, Ukn, "mlddone", "" }, /* 166 */
1205 + { 0, 2, "secadvise", "xx" }, /* 167 */
1206 + { 0, Ukn, "online", "" }, /* 168 */
1207 + { sys_setitimer, 3, "setitimer", "dxx" }, /* 169 */
1208 + { sys_getitimer, 2, "getitimer", "dx" }, /* 170 */
1209 + { sys_gettimeofday, 2, "gettimeofday", "xx" }, /* 171 */
1210 + { sys_settimeofday, 2, "settimeofday", "xx" }, /* 172 */
1211 + { 0, Ukn, "lwpcreate", "" }, /* 173 */
1212 + { 0, Ukn, "lwpexit", "" }, /* 174 */
1213 + { 0, Ukn, "lwpwait", "" }, /* 175 */
1214 + { 0, Ukn, "lwpself", "" }, /* 176 */
1215 + { 0, Ukn, "lwpinfo", "" }, /* 177 */
1216 + { 0, Ukn, "lwpprivate", "" }, /* 178 */
1217 + { 0, Ukn, "processorbind","" }, /* 179 */
1218 + { 0, Ukn, "processorexbind","" }, /* 180 */
1219 + { 0, Ukn, "", "" }, /* 181 */
1220 + { 0, Ukn, "sync_mailbox", "" }, /* 182 */
1221 + { 0, Ukn, "prepblock", "" }, /* 183 */
1222 + { 0, Ukn, "block", "" }, /* 184 */
1223 + { 0, Ukn, "rdblock", "" }, /* 185 */
1224 + { 0, Ukn, "unblock", "" }, /* 186 */
1225 + { 0, Ukn, "cancelblock", "" }, /* 187 */
1226 + { 0, Ukn, "?", "" }, /* 188 */
1227 + { 0, Ukn, "pread", "" }, /* 189 */
1228 + { 0, Ukn, "pwrite", "" }, /* 190 */
1229 + { sys_truncate, 2, "truncate", "sd" }, /* 191 */
1230 + { sys_ftruncate, 2, "ftruncate", "dd" }, /* 192 */
1231 + { 0, Ukn, "lwpkill", "" }, /* 193 */
1232 + { 0, Ukn, "sigwait", "" }, /* 194 */
1233 + { 0, Ukn, "fork1", "" }, /* 195 */
1234 + { 0, Ukn, "forkall", "" }, /* 196 */
1235 + { 0, Ukn, "modload", "" }, /* 197 */
1236 + { 0, Ukn, "moduload", "" }, /* 198 */
1237 + { 0, Ukn, "modpath", "" }, /* 199 */
1238 + { 0, Ukn, "modstat", "" }, /* 200 */
1239 + { 0, Ukn, "modadm", "" }, /* 201 */
1240 + { 0, Ukn, "getksym", "" }, /* 202 */
1241 + { 0, Ukn, "lwpsuspend", "" }, /* 203 */
1242 + { 0, Ukn, "lwpcontinue", "" }, /* 204 */
1243 + { 0, Ukn, "?", "" }, /* 205 */
1244 + { 0, Ukn, "?", "" }, /* 206 */
1245 + { 0, Ukn, "?", "" }, /* 207 */
1246 + { 0, Ukn, "?", "" },
1247 + { 0, Ukn, "?", "" },
1248 + { 0, Ukn, "?", "" },
1249 + { 0, Ukn, "?", "" },
1250 + { 0, Ukn, "?", "" },
1251 + { 0, Ukn, "?", "" },
1252 + { 0, Ukn, "?", "" },
1253 + { 0, Ukn, "?", "" }
1257 +ibcs_lcall7(int segment, struct pt_regs *regs)
1259 + int sysno = regs->eax & 0xff;
1261 + if (sysno >= ARRAY_SIZE(ibcs_syscall_table))
1262 + set_error(regs, iABI_errors(-EINVAL));
1264 + lcall7_dispatch(regs, &ibcs_syscall_table[regs->eax & 0xff], 1);
1267 +static struct exec_domain ibcs_exec_domain = {
1268 + name: "iBCS2/iABI4",
1269 + handler: ibcs_lcall7,
1270 + pers_low: 1 /* PER_SVR4 */,
1271 + pers_high: 2 /* PER_SVR3 */,
1272 + signal_map: ibcs_to_linux_signals,
1273 + signal_invmap: linux_to_ibcs_signals,
1274 + err_map: ibcs_err_map,
1275 + socktype_map: ibcs_socktype_map,
1276 + sockopt_map: ibcs_sockopt_map,
1277 + af_map: ibcs_af_map,
1278 + module: THIS_MODULE
1284 + return register_exec_domain(&ibcs_exec_domain);
1291 + unregister_exec_domain(&ibcs_exec_domain);
1294 +module_init(ibcs_init);
1295 +module_exit(ibcs_exit);
1296 diff -Nru linux-2.6.7/abi/isc/Makefile linux-2.6.7-abi/abi/isc/Makefile
1297 --- linux-2.6.7/abi/isc/Makefile 1970-01-01 01:00:00.000000000 +0100
1298 +++ linux-2.6.7-abi/abi/isc/Makefile 2004-07-22 17:44:20.000000000 +0200
1301 +abi-isc-objs := sysent.o
1303 +obj-$(CONFIG_ABI_ISC) += abi-isc.o
1305 +abi-isc.o: $(abi-isc-objs)
1306 + $(LD) -r -o $@ $(abi-isc-objs)
1307 diff -Nru linux-2.6.7/abi/isc/sysent.c linux-2.6.7-abi/abi/isc/sysent.c
1308 --- linux-2.6.7/abi/isc/sysent.c 1970-01-01 01:00:00.000000000 +0100
1309 +++ linux-2.6.7-abi/abi/isc/sysent.c 2004-07-22 17:44:20.000000000 +0200
1312 + * Copyright (c) 2001 Christoph Hellwig.
1313 + * All rights reserved.
1315 + * This program is free software; you can redistribute it and/or modify
1316 + * it under the terms of the GNU General Public License as published by
1317 + * the Free Software Foundation; either version 2 of the License, or
1318 + * (at your option) any later version.
1320 + * This program is distributed in the hope that it will be useful,
1321 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1322 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1323 + * GNU General Public License for more details.
1325 + * You should have received a copy of the GNU General Public License
1326 + * along with this program; if not, write to the Free Software
1327 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1333 + * ISC personality switch.
1335 +#include <linux/config.h>
1336 +#include <linux/kernel.h>
1337 +#include <linux/module.h>
1338 +#include <linux/init.h>
1339 +#include <linux/personality.h>
1340 +#include <linux/syscalls.h>
1341 +#include <linux/socket.h>
1342 +#include <linux/net.h>
1343 +#include <asm/uaccess.h>
1345 +#include <abi/svr4/sysent.h>
1346 +#include <abi/signal.h>
1348 +#include <abi/util/errno.h>
1349 +#include <abi/util/sysent.h>
1350 +#include <abi/util/socket.h>
1352 +MODULE_DESCRIPTION("ISC personality");
1353 +MODULE_AUTHOR("Christoph Hellwig, partially taken from iBCS");
1354 +MODULE_LICENSE("GPL");
1358 +static int isc_setostype(int);
1361 + * We could remove some of the long identity mapped runs but at the
1362 + * expense of extra comparisons for each mapping at run time...
1364 +static u_char isc_err_table[] = {
1365 +/* 0 - 9 */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
1366 +/* 10 - 19 */ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1367 +/* 20 - 29 */ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
1368 +/* 30 - 39 */ 30, 31, 32, 33, 34, 45, 78, 46, 89, 93,
1369 +/* 40 - 49 */ 90, 90, 35, 36, 37, 38, 39, 40, 41, 42,
1370 +/* 50 - 59 */ 43, 44, 50, 51, 52, 53, 54, 55, 56, 57,
1371 +/* 60 - 69 */ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
1372 +/* 70 - 79 */ 70, 71, 74, 76, 77, 79, 80, 81, 82, 83,
1373 +/* 80 - 89 */ 84, 85, 86, 87, 88, 91, 92, 94, 95, 96,
1374 +/* 90 - 99 */ 97, 98, 99, 120, 121, 122, 123, 124, 125, 126,
1375 +/* 100 - 109 */ 127, 128, 129, 130, 131, 132, 133, 134, 143, 144,
1376 +/* 110 - 119 */ 145, 146, 147, 148, 149, 150, 22, 135, 137, 138,
1377 +/* 120 - 122 */ 139, 140, 28
1381 + * Map Linux RESTART* values (512,513,514) to EINTR
1383 +static u_char lnx_err_table[] = {
1384 +/* 512 - 514 */ EINTR, EINTR, EINTR
1387 +struct map_segment isc_err_map[] = {
1388 + { 0, 0+sizeof(isc_err_table)-1, isc_err_table },
1389 + { 512, 512+sizeof(lnx_err_table)-1, lnx_err_table },
1394 + * ISC's error mapping is a little different.
1396 +static long linux_to_isc_signals[NSIGNALS+1] = {
1397 +/* 0 - 3 */ 0, IBCS_SIGHUP, IBCS_SIGINT, IBCS_SIGQUIT,
1398 +/* 4 - 7 */ IBCS_SIGILL, IBCS_SIGTRAP, IBCS_SIGABRT, -1,
1399 +/* 8 - 11 */ IBCS_SIGFPE, IBCS_SIGKILL, IBCS_SIGUSR1, IBCS_SIGSEGV,
1400 +/* 12 - 15 */ IBCS_SIGUSR2, IBCS_SIGPIPE, IBCS_SIGALRM, IBCS_SIGTERM,
1401 +/* 16 - 19 */ IBCS_SIGSEGV, IBCS_SIGCHLD, ISC_SIGCONT, ISC_SIGSTOP,
1402 +/* 20 - 23 */ ISC_SIGTSTP, IBCS_SIGTTIN, IBCS_SIGTTOU, IBCS_SIGUSR1,
1403 +/* 24 - 27 */ IBCS_SIGGXCPU, IBCS_SIGGXFSZ, IBCS_SIGVTALRM, IBCS_SIGPROF,
1404 +/* 28 - 31 */ IBCS_SIGWINCH, IBCS_SIGIO, IBCS_SIGPWR, -1,
1408 +static long isc_to_linux_signals[NSIGNALS+1] = {
1409 +/* 0 - 3 */ 0, SIGHUP, SIGINT, SIGQUIT,
1410 +/* 4 - 7 */ SIGILL, SIGTRAP, SIGIOT, SIGUNUSED,
1411 +/* 8 - 11 */ SIGFPE, SIGKILL, SIGUNUSED, SIGSEGV,
1412 +/* 12 - 15 */ SIGUNUSED, SIGPIPE, SIGALRM, SIGTERM,
1413 +/* 16 - 19 */ SIGUSR1, SIGUSR2, SIGCHLD, SIGPWR,
1414 +/* 20 - 23 */ SIGWINCH, -1, SIGPOLL, SIGCONT,
1415 +/* 24 - 27 */ SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU,
1416 +/* 28 - 31 */ SIGVTALRM, SIGPROF, SIGXCPU, SIGXFSZ,
1420 +static char isc_socktype[] = {
1429 +static struct map_segment isc_socktype_map[] = {
1430 + { 1, 6, isc_socktype },
1434 +static struct map_segment isc_sockopt_map[] = {
1435 + { 0x0001, 0x0001, (char *)SO_DEBUG },
1436 + { 0x0002, 0x0002, (char *)__SO_ACCEPTCON },
1437 + { 0x0004, 0x0004, (char *)SO_REUSEADDR },
1438 + { 0x0008, 0x0008, (char *)SO_KEEPALIVE },
1439 + { 0x0010, 0x0010, (char *)SO_DONTROUTE },
1440 + { 0x0020, 0x0020, (char *)SO_BROADCAST },
1441 + { 0x0040, 0x0040, (char *)SO_USELOOPBACK },
1442 + { 0x0080, 0x0080, (char *)SO_LINGER },
1443 + { 0x0100, 0x0100, (char *)SO_OOBINLINE },
1444 + { 0x0200, 0x0200, (char *)SO_ORDREL },
1445 + { 0x0400, 0x0400, (char *)SO_IMASOCKET },
1446 + { 0x1001, 0x1001, (char *)SO_SNDBUF },
1447 + { 0x1002, 0x1002, (char *)SO_RCVBUF },
1448 + { 0x1003, 0x1003, (char *)SO_SNDLOWAT },
1449 + { 0x1004, 0x1004, (char *)SO_RCVLOWAT },
1450 + { 0x1005, 0x1005, (char *)SO_SNDTIMEO },
1451 + { 0x1006, 0x1006, (char *)SO_RCVTIMEO },
1452 + { 0x1007, 0x1007, (char *)SO_ERROR },
1453 + { 0x1008, 0x1008, (char *)SO_TYPE },
1454 + { 0x1009, 0x1009, (char *)SO_PROTOTYPE },
1458 +static struct map_segment isc_af_map[] = {
1464 +static struct sysent sysisc_table[] = {
1465 +/* 0 */ { 0, Ukn, "sysisc0", "" },
1466 +/* 1 */ { isc_setostype, 1, "setostype", "d" },
1467 +/* 2 */ { sys_rename, 2, "rename", "ss" },
1468 +/* 3 */ { abi_sigaction, 3, "sigaction", "dxx" },
1469 +/* 4 */ { abi_sigprocmask, 3, "sicprocmask", "dxx" },
1470 +/* 5 */ { 0, 1, "sigpending", "x" },
1471 +/* 6 */ { sys_getgroups16, 2, "getgroups", "dp" },
1472 +/* 7 */ { sys_setgroups16, 2, "setgroups", "dp" },
1473 +/* 8 */ { 0, Ukn, "pathconf", "" },
1474 +/* 9 */ { 0, Ukn, "fpathconf", "" },
1475 +/* 10 */ { ibcs_sysconf, 1, "sysconf", "d" },
1476 +/* 11 */ { sys_waitpid, 3, "waitpid", "dxx" },
1477 +/* 12 */ { sys_setsid, 0, "setsid", "" },
1478 +/* 13 */ { sys_setpgid, 2, "setpgid", "dd" },
1479 +/* 14 */ { 0, Ukn, "adduser", "" },
1480 +/* 15 */ { 0, Ukn, "setuser", "" },
1481 +/* 16 */ { 0, Ukn, "sysisc16", "" },
1482 +/* 17 */ { abi_sigsuspend, Spl, "sigsuspend", "x" },
1483 +/* 18 */ { sys_symlink, 2, "symlink", "ss" },
1484 +/* 19 */ { sys_readlink, 3, "readlink", "spd" },
1485 +/* 20 */ { 0, Ukn, "getmajor", "" }
1489 +isc_sysisc(struct pt_regs *regs)
1493 + __get_user(sysno, ((unsigned long *)regs->esp)+1);
1495 + if (sysno >= ARRAY_SIZE(sysisc_table))
1496 + set_error(regs, iABI_errors(-EINVAL));
1498 + lcall7_dispatch(regs, &sysisc_table[sysno], 2);
1502 +isc_setostype(int arg1)
1507 +static struct sysent isc_syscall_table[] = {
1508 + { abi_syscall, Fast, "syscall", "" }, /* 0 */
1509 + { sys_exit, 1, "exit", "d" }, /* 1 */
1510 + { abi_fork, Spl, "fork", "" }, /* 2 */
1511 + { abi_read, 3, "read", "dpd" }, /* 3 */
1512 + { sys_write, 3, "write", "dpd" }, /* 4 */
1513 + { svr4_open, 3, "open", "soo" }, /* 5 */
1514 + { sys_close, 1, "close", "d" }, /* 6 */
1515 + { abi_wait, Spl, "wait", "xxx" }, /* 7 */
1516 + { sys_creat, 2, "creat", "so" }, /* 8 */
1517 + { sys_link, 2, "link", "ss" }, /* 9 */
1518 + { sys_unlink, 1, "unlink", "s" }, /* 10 */
1519 + { abi_exec, Spl, "exec", "sxx" }, /* 11 */
1520 + { sys_chdir, 1, "chdir", "s" }, /* 12 */
1521 + { abi_time, 0, "time", "" }, /* 13 */
1522 + { svr4_mknod, 3, "mknod", "soo" }, /* 14 */
1523 + { sys_chmod, 2, "chmod", "so" }, /* 15 */
1524 + { sys_chown, 3, "chown", "sdd" }, /* 16 */
1525 + { abi_brk, 1, "brk/break", "x" }, /* 17 */
1526 + { svr4_stat, 2, "stat", "sp" }, /* 18 */
1527 + { sys_lseek, 3, "seek/lseek", "ddd" }, /* 19 */
1528 + { abi_getpid, Spl, "getpid", "" }, /* 20 */
1529 + { 0, Ukn, "mount", "" }, /* 21 */
1530 + { sys_umount, 1, "umount", "s" }, /* 22 */
1531 + { sys_setuid, 1, "setuid", "d" }, /* 23 */
1532 + { abi_getuid, Spl, "getuid", "" }, /* 24 */
1533 + { sys_stime, 1, "stime", "d" }, /* 25 */
1534 + { 0, Ukn, "ptrace", "" }, /* 26 */
1535 + { sys_alarm, 1, "alarm", "d" }, /* 27 */
1536 + { svr4_fstat, 2, "fstat", "dp" }, /* 28 */
1537 + { sys_pause, 0, "pause", "" }, /* 29 */
1538 + { sys_utime, 2, "utime", "xx" }, /* 30 */
1539 + { 0, Ukn, "stty", "" }, /* 31 */
1540 + { 0, Ukn, "gtty", "" }, /* 32 */
1541 + { sys_access, 2, "access", "so" }, /* 33 */
1542 + { sys_nice, 1, "nice", "d" }, /* 34 */
1543 + { svr4_statfs, 4, "statfs", "spdd" }, /* 35 */
1544 + { sys_sync, 0, "sync", "" }, /* 36 */
1545 + { abi_kill, 2, "kill", "dd" }, /* 37 */
1546 + { svr4_fstatfs, 4, "fstatfs", "dpdd" }, /* 38 */
1547 + { abi_procids, Spl, "procids", "d" }, /* 39 */
1548 + { 0, Ukn, "cxenix", "" }, /* 40 */
1549 + { sys_dup, 1, "dup", "d" }, /* 41 */
1550 + { abi_pipe, Spl, "pipe", "" }, /* 42 */
1551 + { sys_times, 1, "times", "p" }, /* 43 */
1552 + { 0, Ukn, "prof", "" }, /* 44 */
1553 + { 0, Ukn, "lock/plock", "" }, /* 45 */
1554 + { sys_setgid, 1, "setgid", "d" }, /* 46 */
1555 + { abi_getgid, Spl, "getgid", "" }, /* 47 */
1556 + { abi_sigfunc, Fast, "sigfunc", "xxx" }, /* 48 */
1557 + { svr4_msgsys, Spl, "msgsys", "dxddd" }, /* 49 */
1558 + { svr4_sysi86, 3, "sysi86", "d" }, /* 50 */
1559 + { sys_acct, 1, "acct/sysacct", "x" }, /* 51 */
1560 + { svr4_shmsys, Fast, "shmsys", "ddxo" }, /* 52 */
1561 + { svr4_semsys, Spl, "semsys", "dddx" }, /* 53 */
1562 + { svr4_ioctl, Spl, "ioctl", "dxx" }, /* 54 */
1563 + { 0, 3, "uadmin", "xxx" }, /* 55 */
1564 + { 0, Ukn, "?", "" }, /* 56 */
1565 + { v7_utsname, 1, "utsys", "x" }, /* 57 */
1566 + { sys_fsync, 1, "fsync", "d" }, /* 58 */
1567 + { abi_exec, Spl, "execv", "spp" }, /* 59 */
1568 + { sys_umask, 1, "umask", "o" }, /* 60 */
1569 + { sys_chroot, 1, "chroot", "s" }, /* 61 */
1570 + { svr4_fcntl, 3, "fcntl", "dxx" }, /* 62 */
1571 + { svr4_ulimit, 2, "ulimit", "xx" }, /* 63 */
1572 + { 0, Ukn, "?", "" }, /* 64 */
1573 + { 0, Ukn, "?", "" }, /* 65 */
1574 + { 0, Ukn, "?", "" }, /* 66 */
1575 + { 0, Ukn, "?", "" }, /* 67 */
1576 + { 0, Ukn, "?", "" }, /* 68 */
1577 + { 0, Ukn, "?", "" }, /* 69 */
1578 + { 0, Ukn, "advfs", "" }, /* 70 */
1579 + { 0, Ukn, "unadvfs", "" }, /* 71 */
1580 + { 0, Ukn, "rmount", "" }, /* 72 */
1581 + { 0, Ukn, "rumount", "" }, /* 73 */
1582 + { 0, Ukn, "rfstart", "" }, /* 74 */
1583 + { 0, Ukn, "?", "" }, /* 75 */
1584 + { 0, Ukn, "rdebug", "" }, /* 76 */
1585 + { 0, Ukn, "rfstop", "" }, /* 77 */
1586 + { 0, Ukn, "rfsys", "" }, /* 78 */
1587 + { sys_rmdir, 1, "rmdir", "s" }, /* 79 */
1588 + { abi_mkdir, 2, "mkdir", "so" }, /* 80 */
1589 + { svr4_getdents, 3, "getdents", "dxd" }, /* 81 */
1590 + { 0, Ukn, "libattach", "" }, /* 82 */
1591 + { 0, Ukn, "libdetach", "" }, /* 83 */
1592 + { svr4_sysfs, 3, "sysfs", "dxx" }, /* 84 */
1593 + { svr4_getmsg, Spl, "getmsg", "dxxx" }, /* 85 */
1594 + { svr4_putmsg, Spl, "putmsg", "dxxd" }, /* 86 */
1595 + { sys_poll, 3, "poll", "xdd" }, /* 87 */
1596 + { svr4_lstat, 2, "lstat", "sp" }, /* 88 */
1597 + { sys_symlink, 2, "symlink", "ss" }, /* 89 */
1598 + { sys_readlink, 3, "readlink", "spd" }, /* 90 */
1599 + { sys_setgroups, 2, "setgroups", "dp" }, /* 91 */
1600 + { sys_getgroups, 2, "getgroups", "dp" }, /* 92 */
1601 + { sys_fchmod, 2, "fchmod", "do" }, /* 93 */
1602 + { sys_fchown, 3, "fchown", "ddd" }, /* 94 */
1603 + { abi_sigprocmask, 3, "sigprocmask", "dxx" }, /* 95 */
1604 + { abi_sigsuspend, Spl, "sigsuspend", "x" }, /* 96 */
1605 + { 0, 2, "sigaltstack", "xx" }, /* 97 */
1606 + { abi_sigaction, 3, "sigaction", "dxx" }, /* 98 */
1607 + { svr4_sigpending, 2, "sigpending", "dp" }, /* 99 */
1608 + { svr4_context, Spl, "context", "" }, /* 100 */
1609 + { 0, Ukn, "evsys", "" }, /* 101 */
1610 + { 0, Ukn, "evtrapret", "" }, /* 102 */
1611 + { svr4_statvfs, 2, "statvfs", "sp" }, /* 103 */
1612 + { svr4_fstatvfs, 2, "fstatvfs", "dp" }, /* 104 */
1613 + { isc_sysisc, Fast, "sysisc", "" }, /* 105 */
1614 + { 0, Ukn, "nfssys", "" }, /* 106 */
1615 + { 0, 4, "waitid", "ddxd" }, /* 107 */
1616 + { 0, 3, "sigsendsys", "ddd" }, /* 108 */
1617 + { svr4_hrtsys, Spl, "hrtsys", "xxx" }, /* 109 */
1618 + { 0, 3, "acancel", "dxd" }, /* 110 */
1619 + { 0, Ukn, "async", "" }, /* 111 */
1620 + { 0, Ukn, "priocntlsys", "" }, /* 112 */
1621 + { svr4_pathconf, 2, "pathconf", "sd" }, /* 113 */
1622 + { 0, 3, "mincore", "xdx" }, /* 114 */
1623 + { svr4_mmap, 6, "mmap", "xxxxdx"},/* 115 */
1624 + { sys_mprotect, 3, "mprotect", "xdx" },/* 116 */
1625 + { sys_munmap, 2, "munmap", "xd" },/* 117 */
1626 + { svr4_fpathconf, 2, "fpathconf", "dd" }, /* 118 */
1627 + { abi_fork, Spl, "vfork", "" }, /* 119 */
1628 + { sys_fchdir, 1, "fchdir", "d" }, /* 120 */
1629 + { sys_readv, 3, "readv", "dxd" }, /* 121 */
1630 + { sys_writev, 3, "writev", "dxd" }, /* 122 */
1631 + { svr4_xstat, 3, "xstat", "dsx" }, /* 123 */
1632 + { svr4_lxstat, 3, "lxstat", "dsx" }, /* 124 */
1633 + { svr4_fxstat, 3, "fxstat", "ddx" }, /* 125 */
1634 + { svr4_xmknod, 4, "xmknod", "dsox" }, /* 126 */
1635 + { 0, Ukn, "syslocal", "d" }, /* 127 */
1636 + { svr4_getrlimit, 2, "setrlimit", "dx" }, /* 128 */
1637 + { svr4_setrlimit, 2, "getrlimit", "dx" }, /* 129 */
1638 + { 0, 3, "lchown", "sdd" }, /* 130 */
1639 + { 0, Ukn, "memcntl", "" }, /* 131 */
1640 +#if defined(CONFIG_ABI_XTI)
1641 + { svr4_getpmsg, 5, "getpmsg", "dxxxx" }, /* 132 */
1642 + { svr4_putpmsg, 5, "putpmsg", "dxxdd" }, /* 133 */
1644 + { 0, 5, "getpmsg", "dxxxx" }, /* 132 */
1645 + { 0, 5, "putpmsg", "dxxdd" }, /* 133 */
1647 + { sys_rename, 2, "rename", "ss" }, /* 134 */
1648 + { abi_utsname, 1, "uname", "x" }, /* 135 */
1649 + { svr4_setegid, 1, "setegid", "d" }, /* 136 */
1650 + { svr4_sysconfig, 1, "sysconfig", "d" }, /* 137 */
1651 + { 0, Ukn, "adjtime", "" }, /* 138 */
1652 + { svr4_sysinfo, 3, "systeminfo", "dsd" }, /* 139 */
1653 + { socksys_syscall, 1, "socksys", "x" }, /* 140 */
1654 + { svr4_seteuid, 1, "seteuid", "d" }, /* 141 */
1655 + { 0, Ukn, "?", "" }, /* 142 */
1656 + { 0, Ukn, "?", "" }, /* 143 */
1657 + { 0, 2, "secsys", "dx" }, /* 144 */
1658 + { 0, 4, "filepriv", "sdxd" }, /* 145 */
1659 + { 0, 3, "procpriv", "dxd" }, /* 146 */
1660 + { 0, 3, "devstat", "sdx" }, /* 147 */
1661 + { 0, 5, "aclipc", "ddddx" }, /* 148 */
1662 + { 0, 3, "fdevstat", "ddx" }, /* 149 */
1663 + { 0, 3, "flvlfile", "ddx" }, /* 150 */
1664 + { 0, 3, "lvlfile", "sdx" }, /* 151 */
1665 + { 0, Ukn, "?", "" }, /* 152 */
1666 + { 0, 2, "lvlequal", "xx" }, /* 153 */
1667 + { 0, 2, "lvlproc", "dx" }, /* 154 */
1668 + { 0, Ukn, "?", "" }, /* 155 */
1669 + { 0, 4, "lvlipc", "dddx" }, /* 156 */
1670 + { 0, 4, "acl", "sddx" }, /* 157 */
1671 + { 0, Ukn, "auditevt", "" }, /* 158 */
1672 + { 0, Ukn, "auditctl", "" }, /* 159 */
1673 + { 0, Ukn, "auditdmp", "" }, /* 160 */
1674 + { 0, Ukn, "auditlog", "" }, /* 161 */
1675 + { 0, Ukn, "auditbuf", "" }, /* 162 */
1676 + { 0, 2, "lvldom", "xx" }, /* 163 */
1677 + { 0, Ukn, "lvlvfs", "" }, /* 164 */
1678 + { 0, 2, "mkmld", "so" }, /* 165 */
1679 + { 0, Ukn, "mlddone", "" }, /* 166 */
1680 + { 0, 2, "secadvise", "xx" }, /* 167 */
1681 + { 0, Ukn, "online", "" }, /* 168 */
1682 + { sys_setitimer, 3, "setitimer", "dxx" }, /* 169 */
1683 + { sys_getitimer, 2, "getitimer", "dx" }, /* 170 */
1684 + { sys_gettimeofday, 2, "gettimeofday", "xx" }, /* 171 */
1685 + { sys_settimeofday, 2, "settimeofday", "xx" }, /* 172 */
1686 + { 0, Ukn, "lwpcreate", "" }, /* 173 */
1687 + { 0, Ukn, "lwpexit", "" }, /* 174 */
1688 + { 0, Ukn, "lwpwait", "" }, /* 175 */
1689 + { 0, Ukn, "lwpself", "" }, /* 176 */
1690 + { 0, Ukn, "lwpinfo", "" }, /* 177 */
1691 + { 0, Ukn, "lwpprivate", "" }, /* 178 */
1692 + { 0, Ukn, "processorbind","" }, /* 179 */
1693 + { 0, Ukn, "processorexbind","" }, /* 180 */
1694 + { 0, Ukn, "", "" }, /* 181 */
1695 + { 0, Ukn, "sync_mailbox", "" }, /* 182 */
1696 + { 0, Ukn, "prepblock", "" }, /* 183 */
1697 + { 0, Ukn, "block", "" }, /* 184 */
1698 + { 0, Ukn, "rdblock", "" }, /* 185 */
1699 + { 0, Ukn, "unblock", "" }, /* 186 */
1700 + { 0, Ukn, "cancelblock", "" }, /* 187 */
1701 + { 0, Ukn, "?", "" }, /* 188 */
1702 + { 0, Ukn, "pread", "" }, /* 189 */
1703 + { 0, Ukn, "pwrite", "" }, /* 190 */
1704 + { sys_truncate, 2, "truncate", "sd" }, /* 191 */
1705 + { sys_ftruncate, 2, "ftruncate", "dd" }, /* 192 */
1706 + { 0, Ukn, "lwpkill", "" }, /* 193 */
1707 + { 0, Ukn, "sigwait", "" }, /* 194 */
1708 + { 0, Ukn, "fork1", "" }, /* 195 */
1709 + { 0, Ukn, "forkall", "" }, /* 196 */
1710 + { 0, Ukn, "modload", "" }, /* 197 */
1711 + { 0, Ukn, "moduload", "" }, /* 198 */
1712 + { 0, Ukn, "modpath", "" }, /* 199 */
1713 + { 0, Ukn, "modstat", "" }, /* 200 */
1714 + { 0, Ukn, "modadm", "" }, /* 201 */
1715 + { 0, Ukn, "getksym", "" }, /* 202 */
1716 + { 0, Ukn, "lwpsuspend", "" }, /* 203 */
1717 + { 0, Ukn, "lwpcontinue", "" }, /* 204 */
1718 + { 0, Ukn, "?", "" }, /* 205 */
1719 + { 0, Ukn, "?", "" }, /* 206 */
1720 + { 0, Ukn, "?", "" }, /* 207 */
1721 + { 0, Ukn, "?", "" },
1722 + { 0, Ukn, "?", "" },
1723 + { 0, Ukn, "?", "" },
1724 + { 0, Ukn, "?", "" },
1725 + { 0, Ukn, "?", "" },
1726 + { 0, Ukn, "?", "" },
1727 + { 0, Ukn, "?", "" },
1728 + { 0, Ukn, "?", "" }
1732 +isc_lcall7(int segment, struct pt_regs *regs)
1734 + int sysno = regs->eax & 0xff;
1736 + if (sysno >= ARRAY_SIZE(isc_syscall_table))
1737 + set_error(regs, iABI_errors(-EINVAL));
1739 + lcall7_dispatch(regs, &isc_syscall_table[sysno], 1);
1742 +static struct exec_domain isc_exec_domain = {
1744 + handler: isc_lcall7,
1745 + pers_low: 5 /* PER_ISCR4 */,
1746 + pers_high: 5 /* PER_ISCR4 */,
1747 + signal_map: isc_to_linux_signals,
1748 + signal_invmap: linux_to_isc_signals,
1749 + err_map: isc_err_map,
1750 + socktype_map: isc_socktype_map,
1751 + sockopt_map: isc_sockopt_map,
1752 + af_map: isc_af_map,
1753 + module: THIS_MODULE
1759 + return register_exec_domain(&isc_exec_domain);
1766 + unregister_exec_domain(&isc_exec_domain);
1769 +module_init(isc_init);
1770 +module_exit(isc_exit);
1771 diff -Nru linux-2.6.7/abi/Kconfig linux-2.6.7-abi/abi/Kconfig
1772 --- linux-2.6.7/abi/Kconfig 1970-01-01 01:00:00.000000000 +0100
1773 +++ linux-2.6.7-abi/abi/Kconfig 2004-07-22 17:44:20.000000000 +0200
1776 +# Linux-ABI configuration
1779 +# this file gets source'ed into the kernel file formats menu entry
1780 +# via ./fs/Kconfig.binfmt
1783 + bool "Extended Linux-ABI support (alien binarys and syscalls)"
1787 + Support for a few alien syscall interfaces. This allows you to run
1788 + a binary that got build for other Unix compatible platforms.
1792 + tristate "SVR3/SVR4 family syscall support for x86 binarys"
1798 +comment "SVR3/SVR4 based syscall support for x86: (please check one or more)"
1799 + depends on ABI_SVR4
1802 + tristate "iBCS2/iABI4 syscall support"
1803 + depends on ABI_SVR4
1806 + tristate "ISC syscall support"
1807 + depends on ABI_SVR4
1810 + tristate "SCO OpenServer 5/SCO Unix 3.x/Xenix syscall support"
1811 + depends on ABI_SVR4
1814 + tristate "Solaris 2.x syscall support"
1815 + depends on ABI_SVR4
1818 + tristate "UnixWare 7.x syscall support"
1819 + depends on ABI_SVR4
1822 + tristate "Wyse V/386 syscall support"
1823 + depends on ABI_SVR4
1826 +comment "SVR3/SVR4 related binary format support for x86:"
1827 + depends on ABI_SVR4
1830 + tristate "COFF binary support (SVR3)"
1831 + depends on ABI_SVR4
1834 + tristate "x.out binary support (Xenix)"
1835 + depends on ABI_SVR4
1837 +config BINFMT_XOUT_X286
1838 + bool "x.out segmented binary support (Xenix/80286)"
1839 + depends on BINFMT_XOUT
1842 +config ABI_LATE_PROBING
1844 + prompt "Late probing of personality trough syscall handler"
1848 + There is a minor general uncertainty on identification of binary
1849 + formats. It might happen that statically linked SVr4 binary could
1850 + be falsely assigned to a Linux personality. Solaris/x86 binarys
1851 + are another sample for a falsely assigned Linux personality.
1852 + If this option is set the lcall handler for Linux will switch
1853 + to SVr4 personality as soon as lcall 0x07 is used, or it will
1854 + switch to Solaris personality when lcall 0x27 is used.
1855 + Since this on-the-fly personality switching is a one way path
1856 + a malicious program might make use of exactly that ability.
1857 + For system consistency reasons personality detection should go
1858 + that way. The better solution is to improve the personality
1859 + detection code at load time in contrast to runtime detection.
1860 + At present load time probing is not perfect, so better say yes.
1864 + prompt "Include prints for syscall tracking via ABI_TRACE ioctl"
1868 + This option allows to control the inclusion of code that prints
1869 + kernel messages for tracking special syscalls events like errors.
1870 + Typically this messages further have to be enabled via the
1871 + ABI_TRACE ioctl. This option will not remove the ioctl interface
1872 + but will only remove the backend coding which produces the prints.
1873 + You can disable thise option if you want to reduce the kernel size
1874 + or have other concerns, e.g. code size or possible message floods.
1876 +# --- internal options, values will get derived from prior settings ---
1878 +# the abi-util (./abi/util) codebase
1879 +# does currently only contain code for the ABI_TRACE coding
1880 +# and has to be present as soon as the SVR4 code is present.
1883 + depends on ABI_TRACE
1884 + default y if ABI_SVR4=y
1885 + default m if ABI_SVR4=m
1898 +config ABI_TLI_OPTMGMT
1903 +config ABI_XTI_OPTMGMT
1908 +# there are syscall interfaces which do get statically linked
1909 +config ABI_SYSCALL_STATICS
1911 + default y if ABI_UW7=y || ABI_SOLARIS=y || ABI_IBCS=y || ABI_ISC=y || ABI_SCO=y || ABI_WYSE=y
1914 +# there are syscall interfaces which do get build as module
1915 +config ABI_SYSCALL_MODULES
1917 + default y if ABI_UW7=m || ABI_SOLARIS=m || ABI_IBCS=m || ABI_ISC=m || ABI_SCO=m || ABI_WYSE=m
1920 +# the LCALL7 code for SVR4 family support must _not_ be a module
1921 +# when there is at least a single, statically bound syscall driver.
1922 +# if there are only modules, then the LCALL code can be a module as well.
1923 +# if there is no module at all then we dont need the LCALL7 code.
1926 + default y if ABI_SYSCALL_STATICS=y
1927 + default m if ABI_SYSCALL_MODULES=y
1931 +# * only a static SVR4 core coding will allow static syscall drivers,
1932 +# * setting a syscall driver to modules will be the only way to allow
1933 +# this single module to plug into SVR4 core coding.
1934 +# * there is no generic "register my entrypoints" request for modules
1935 +# in the curent codebase. (this might be a TODO)
1936 +# * the exported LCALL7 syms will only be usefull to syscall driver modules.
1937 +# * LCALL7 is only usefull if there are syscall drivers (static or module).
1938 +# * an "empty" SVR4 might be usefull for debugging and non-x86 targets.
1941 diff -Nru linux-2.6.7/abi/Makefile linux-2.6.7-abi/abi/Makefile
1942 --- linux-2.6.7/abi/Makefile 1970-01-01 01:00:00.000000000 +0100
1943 +++ linux-2.6.7-abi/abi/Makefile 2004-07-22 17:44:20.000000000 +0200
1945 +obj-$(CONFIG_ABI) += util/
1946 +obj-$(CONFIG_ABI_SVR4) += svr4/
1947 +obj-$(CONFIG_ABI_SCO) += sco/ cxenix/
1948 +obj-$(CONFIG_ABI_WYSE) += wyse/
1949 +obj-$(CONFIG_ABI_UW7) += uw7/
1950 +obj-$(CONFIG_ABI_SOLARIS) += solaris/
1951 +obj-$(CONFIG_ABI_IBCS) += ibcs/
1952 +obj-$(CONFIG_ABI_ISC) += isc/
1953 diff -Nru linux-2.6.7/abi/sco/ioctl.c linux-2.6.7-abi/abi/sco/ioctl.c
1954 --- linux-2.6.7/abi/sco/ioctl.c 1970-01-01 01:00:00.000000000 +0100
1955 +++ linux-2.6.7-abi/abi/sco/ioctl.c 2004-07-22 17:44:20.000000000 +0200
1958 + * ioctl.c - SCO Unix ioctl(2) switch
1960 + * Copyright (C) 1991, 1992 Linus Torvalds
1962 + * Written by Drew Sullivan.
1963 + * Rewritten by Mike Jagdis.
1968 +#include <linux/config.h>
1969 +#include <linux/errno.h>
1970 +#include <linux/kernel.h>
1971 +#include <linux/ptrace.h>
1972 +#include <asm/uaccess.h>
1974 +#include <asm/abi_machdep.h>
1975 +#include <abi/sco/ioctl.h>
1976 +#include <abi/svr4/ioctl.h>
1980 + * do_ioctl() is a meta mapper, that is
1981 + * it looks up the class of the ioctl and then
1982 + * dispatchs to lower level routines to handle the
1983 + * mapping of the actual ioctls
1986 +do_ioctl(struct pt_regs *regs, int fd, unsigned long ioctl_num, void *arg)
1988 + unsigned int class = ioctl_num >> 8;
1989 + char class_str[4];
1994 + * SCO ioctls on the pseudo NFS device probably.
1997 + return abi_ioctl_socksys(fd, ioctl_num, arg);
2000 + * SCO console keyboard stuff?
2006 + return sco_tape_ioctl(fd, ioctl_num, arg);
2009 + return bsd_ioctl_termios(fd, ioctl_num, arg);
2012 + return svr4_fil_ioctl(fd, ioctl_num, arg);
2015 + * Xenix ioctl compatibility.
2018 + return svr4_term_ioctl(fd, ioctl_num & 0xFF, arg);
2020 + case ('i' << 16) | ('X' << 8): /* iBCS2 POSIX */
2021 + case 'x': /* Pre-iBCS2 POSIX */
2022 + return sco_term_ioctl(fd, ioctl_num & 0xFF, arg);
2026 + return svr4_console_ioctl(fd, ioctl_num, arg);
2028 + case ('i' << 16) | ('C' << 8): /* iBCS2 POSIX */
2029 + return svr4_video_ioctl(fd, ioctl_num & 0xFF, arg);
2032 + * These aren't implemented and are never likely to be as they
2033 + * are specific to drivers for obscure hardware. (For those
2034 + * that don't know they're the JERQ ioctls. Says it all
2041 + * The 'S' set could also be display mode switch
2042 + * ioctls in a SCO 3.2.x x<4 environment. It should
2043 + * depend on the descriptor they are applied to.
2044 + * According to ISC the Xenix STREAMS ioctls had the
2045 + * high bit set on the command to differentiate them
2046 + * from mode switch ioctls. Yuk, yuk, yuk...
2049 + return svr4_stream_ioctl(regs, fd, ioctl_num & 0x7F, arg);
2052 + * These are STREAMS socket module ioctls.
2055 +#if defined(CONFIG_ABI_XTI)
2056 + return svr4_sockmod_ioctl(fd, ioctl_num & 0xFF, arg);
2062 + * These are SCO <vtkd.h> ioctls - see vtkd.h
2066 + return sco_vtkbd_ioctl(fd, ioctl_num, arg);
2069 + * SCO channel mapping. I can't find any documentation
2070 + * for this. These are the LD?MAP ioctls defined in
2071 + * sys/termio.h and sys/emap.h. They are used by mapchan.
2078 + * If we haven't handled it yet it must be a BSD style ioctl
2079 + * with a (possible) argument description in the high word of
2082 + switch (class & 0xff) {
2085 + * From SVR4 as specified in sys/iocomm.h.
2088 + return svr4_fil_ioctl(fd, ioctl_num, arg);
2091 + * BSD or V7 terminal ioctls.
2094 + return bsd_ioctl_termios(fd, ioctl_num, arg);
2097 + * SVR3 streams based socket TCP/IP ioctls.
2099 + * These are handed over to the standard ioctl
2100 + * handler since /dev/socksys is an emulated device
2101 + * and front ends any sockets created through it.
2102 + * Note that 'S' ioctls without the BSDish argument
2103 + * type in the high bytes are STREAMS ioctls and 'I'
2104 + * ioctls without the BSDish type in the high bytes
2105 + * are the STREAMS socket module ioctls. (see above).
2110 + return abi_ioctl_socksys(fd, ioctl_num, arg);
2114 + * If nothing has handled it yet someone may have to do some
2117 + class_str[0] = class & 0xFF0000 ? (char)((class >> 16) & 0xFF) : '.';
2118 + class_str[1] = class & 0x00FF00 ? (char)((class >> 8) & 0xFF) : '.';
2119 + class_str[2] = class & 0x0000FF ? (char)((class ) & 0xFF) : '.';
2122 + printk(KERN_DEBUG "sco: ioctl(%d, %lx[%s], 0x%p) unsupported\n",
2123 + fd, ioctl_num, class_str, arg);
2129 +sco_ioctl(struct pt_regs *regs)
2135 + fd = (int)get_syscall_parameter(regs, 0);
2136 + num = (u_int)get_syscall_parameter(regs, 1);
2137 + data = (caddr_t)get_syscall_parameter(regs, 2);
2139 + return do_ioctl(regs, fd, num, data);
2141 diff -Nru linux-2.6.7/abi/sco/Makefile linux-2.6.7-abi/abi/sco/Makefile
2142 --- linux-2.6.7/abi/sco/Makefile 1970-01-01 01:00:00.000000000 +0100
2143 +++ linux-2.6.7-abi/abi/sco/Makefile 2004-07-22 17:44:20.000000000 +0200
2146 +abi-sco-objs := sysent.o misc.o mmap.o ptrace.o secureware.o \
2149 +# various ioctl emulation stuff
2150 +abi-sco-objs += ioctl.o termios.o tapeio.o vtkbd.o
2153 +obj-$(CONFIG_ABI_SCO) += abi-sco.o
2155 +abi-sco.o: $(abi-sco-objs)
2156 + $(LD) -r -o $@ $(abi-sco-objs)
2157 diff -Nru linux-2.6.7/abi/sco/misc.c linux-2.6.7-abi/abi/sco/misc.c
2158 --- linux-2.6.7/abi/sco/misc.c 1970-01-01 01:00:00.000000000 +0100
2159 +++ linux-2.6.7-abi/abi/sco/misc.c 2004-07-22 17:44:20.000000000 +0200
2162 + * Copyright (c) 2001 Christoph Hellwig.
2163 + * All rights reserved.
2165 + * This program is free software; you can redistribute it and/or modify
2166 + * it under the terms of the GNU General Public License as published by
2167 + * the Free Software Foundation; either version 2 of the License, or
2168 + * (at your option) any later version.
2170 + * This program is distributed in the hope that it will be useful,
2171 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2172 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2173 + * GNU General Public License for more details.
2175 + * You should have received a copy of the GNU General Public License
2176 + * along with this program; if not, write to the Free Software
2177 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2183 + * Misc SCO syscalls.
2185 +#include <linux/errno.h>
2186 +#include <linux/sched.h>
2187 +#include <linux/file.h>
2188 +#include <linux/types.h>
2189 +#include <linux/spinlock.h>
2190 +#include <linux/stat.h>
2191 +#include <linux/syscalls.h>
2192 +#include <linux/fs.h>
2193 +#include <asm/uaccess.h>
2195 +#include <abi/svr4/sysent.h>
2199 +sco_lseek(int fd, u_long offset, int whence)
2203 + error = sys_lseek(fd, offset, whence);
2204 + if (error == -ESPIPE) {
2205 + struct file *fp = fget(fd);
2210 + ip = fp->f_dentry->d_inode;
2211 + if (ip && (S_ISCHR(ip->i_mode) || S_ISBLK(ip->i_mode)))
2220 +sco_fcntl(int fd, u_int cmd, u_long arg)
2223 + * This could be SCO's get highest fd open if the fd we
2224 + * are called on is -1 otherwise it could be F_CHKFL.
2226 + if (fd == -1 && cmd == 8) {
2227 + struct files_struct *files = current->files;
2230 + /* compare to ./fs/open.c: get_unused_fd */
2231 + spin_lock(&files->file_lock);
2232 + rval = find_first_zero_bit(files->open_fds->fds_bits, files->max_fdset);
2233 + spin_unlock(&files->file_lock);
2238 + return svr4_fcntl(fd, cmd, arg);
2242 +sco_sysi86(int cmd, void *arg1, int arg2)
2245 + case 114 /*SI86GETFEATURES*/ :
2247 + * No, I don't know what these feature flags actually
2248 + * _mean_. This vector just matches SCO OS 5.0.0.
2250 +#define OSR5_FEATURES "\001\001\001\001\001\001\001\001\002\001\001\001"
2251 + arg2 = max(arg2, 12);
2252 + if (copy_to_user(arg1, OSR5_FEATURES, arg2))
2256 + return svr4_sysi86(cmd, arg1, arg2);
2259 diff -Nru linux-2.6.7/abi/sco/mmap.c linux-2.6.7-abi/abi/sco/mmap.c
2260 --- linux-2.6.7/abi/sco/mmap.c 1970-01-01 01:00:00.000000000 +0100
2261 +++ linux-2.6.7-abi/abi/sco/mmap.c 2004-07-22 17:44:20.000000000 +0200
2264 + * Copyright (c) 2001 Caldera Deutschland GmbH.
2265 + * All rights reserved.
2267 + * This program is free software; you can redistribute it and/or modify
2268 + * it under the terms of the GNU General Public License as published by
2269 + * the Free Software Foundation; either version 2 of the License, or
2270 + * (at your option) any later version.
2272 + * This program is distributed in the hope that it will be useful,
2273 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2274 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2275 + * GNU General Public License for more details.
2277 + * You should have received a copy of the GNU General Public License
2278 + * along with this program; if not, write to the Free Software
2279 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2285 + * Support for mmap on SCO OpenServer 5.
2287 +#include <linux/mm.h>
2288 +#include <linux/errno.h>
2289 +#include <linux/file.h>
2290 +#include <linux/mman.h>
2291 +#include <asm/uaccess.h>
2293 +#include <abi/sco/mman.h>
2294 +#include <abi/sco/types.h>
2296 +#include <abi/util/trace.h>
2300 +sco_mmap(u_long addr, size_t len, int prot, int flags, int fd, sco_off_t off)
2302 + struct file *file;
2305 + if (flags & SCO_MAP_UNIMPL) {
2306 +#if defined(CONFIG_ABI_TRACE)
2307 + abi_trace(ABI_TRACE_UNIMPL,
2308 + "unsupported mmap flags: 0x%x\n", flags & SCO_MAP_UNIMPL);
2310 + flags &= ~SCO_MAP_UNIMPL;
2317 + flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
2318 + down_write(¤t->mm->mmap_sem);
2319 + mapaddr = do_mmap(file, addr, len, prot, flags | MAP_FIXED, off);
2320 + up_write(¤t->mm->mmap_sem);
2324 + if (mapaddr == addr)
2328 diff -Nru linux-2.6.7/abi/sco/ptrace.c linux-2.6.7-abi/abi/sco/ptrace.c
2329 --- linux-2.6.7/abi/sco/ptrace.c 1970-01-01 01:00:00.000000000 +0100
2330 +++ linux-2.6.7-abi/abi/sco/ptrace.c 2004-07-22 17:44:20.000000000 +0200
2333 + * ptrace.c - SCO OpenServer ptrace(2) support.
2335 + * Copyright (c) 1995 Mike Jagdis (jaggy@purplet.demon.co.uk)
2341 + * This file is nearly identical to abi/wyse/ptrace.c, please keep it in sync.
2343 +#include <linux/module.h>
2344 +#include <linux/errno.h>
2345 +#include <linux/sched.h>
2346 +#include <linux/kernel.h>
2347 +#include <linux/mm.h>
2348 +#include <linux/personality.h>
2349 +#include <linux/user.h>
2350 +#define __KERNEL_SYSCALLS__
2351 +#include <linux/unistd.h>
2352 +#include <linux/ptrace.h>
2354 +#include <asm/uaccess.h>
2356 +#include <abi/signal.h>
2357 +#include <abi/util/trace.h>
2361 +#define U(X) ((unsigned long)&((struct user *)0)->X)
2363 +static unsigned long sco_to_linux_reg[NREGS] = {
2364 + U(regs.gs), U(regs.fs), U(regs.es), U(regs.ds),
2365 + U(regs.edi), U(regs.esi),
2367 + U(regs.esp /* ESP */),
2368 + U(regs.ebx), U(regs.edx), U(regs.ecx), U(regs.eax),
2369 + U(signal /* Trap */),
2370 + U(reserved /* ERR */),
2371 + U(regs.eip), U(regs.cs), U(regs.eflags),
2372 + U(regs.esp), U(regs.ss)
2375 +#if defined(CONFIG_ABI_TRACE)
2376 +static const char *regnam[] = {
2377 + "EBX", "ECX", "EDX", "ESI", "EDI", "EBP", "EAX",
2378 + "DS", "ES", "FS", "GS", "ORIG_EAX", "EIP", "CS",
2379 + "EFL", "UESP", "SS"
2384 +sco_ptrace(int req, int pid, u_long addr, u_long data)
2389 + * Slight variations between iBCS and Linux codes.
2391 + if (req == PTRACE_ATTACH)
2393 + else if (req == PTRACE_DETACH)
2396 + if (req == 3 || req == 6) {
2397 + /* get offset of u_ar0 */
2398 + if (addr == 0x1200)
2401 + /* remap access to the registers. */
2402 + if ((addr & 0xff00) == 0x4000) { /* Registers */
2403 + addr = (addr & 0xff) >> 2;
2406 + addr = sco_to_linux_reg[addr];
2412 + if (req == 7 && data > 0) {
2413 + if (data > NSIGNALS)
2415 + data = current_thread_info()->exec_domain->signal_map[data];
2418 + if (req == 1 || req == 2 || req == 3) {
2419 + mm_segment_t old_fs = get_fs();
2423 + error = sys_ptrace(req, pid, addr, (long)&res);
2430 +#if defined(CONFIG_ABI_TRACE)
2431 + if (req == 3 || req == 6) {
2432 + abi_trace(ABI_TRACE_API, "%ld [%s] = 0x%08lx\n",
2433 + addr >> 2, (addr >> 2) < ARRAY_SIZE(regnam) ?
2434 + regnam[addr >> 2] : "???",
2435 + req == 3 ? res : data);
2439 + if (req == 1 || req == 2 || req == 3)
2442 + return sys_ptrace(req, pid, addr, data);
2444 diff -Nru linux-2.6.7/abi/sco/secureware.c linux-2.6.7-abi/abi/sco/secureware.c
2445 --- linux-2.6.7/abi/sco/secureware.c 1970-01-01 01:00:00.000000000 +0100
2446 +++ linux-2.6.7-abi/abi/sco/secureware.c 2004-07-22 17:44:20.000000000 +0200
2449 + * Copyright (c) 1994 Mike Jagdis.
2450 + * All rights reserved.
2452 + * This program is free software; you can redistribute it and/or modify
2453 + * it under the terms of the GNU General Public License as published by
2454 + * the Free Software Foundation; either version 2 of the License, or
2455 + * (at your option) any later version.
2457 + * This program is distributed in the hope that it will be useful,
2458 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2459 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2460 + * GNU General Public License for more details.
2462 + * You should have received a copy of the GNU General Public License
2463 + * along with this program; if not, write to the Free Software
2464 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2469 +#include <linux/errno.h>
2470 +#include <linux/kernel.h>
2471 +#include <linux/sched.h>
2474 + * SecureWare, Inc. provided the C2 security subsystem used on SCO Unix.
2475 + * This is not that package. This does not even attempt to emulate
2476 + * that package. This emulates just enough of the "obvious" bits to
2477 + * allow some programs to get a bit further. It is not useful to
2478 + * try to implement C2 security in an emulator. Nor is it particularly
2479 + * useful to run SCO's secure admin programs on Linux anyway...
2482 + SW_GETLUID = 0x01,
2483 + SW_SETLUID = 0x02,
2487 +sw_security(int cmd, void *p1, void *p2, void *p3, void *p4, void *p5)
2492 + * We want the login user id. We don't have it
2493 + * specifically so we'll just use the real uid
2494 + * instead - it should be good enough.
2496 + return (current->uid);
2499 + * Strictly we should only be able to call setluid()
2500 + * once but we can't enforce that. We have the choice
2501 + * between having it always succeed or always fail.
2502 + * Since setluid() should only ever be invoked by
2503 + * things like login processes we always fail it.
2508 + printk(KERN_ERR "%s: unsupported security call cmd=%d\n", __FILE__, cmd);
2511 diff -Nru linux-2.6.7/abi/sco/stat.c linux-2.6.7-abi/abi/sco/stat.c
2512 --- linux-2.6.7/abi/sco/stat.c 1970-01-01 01:00:00.000000000 +0100
2513 +++ linux-2.6.7-abi/abi/sco/stat.c 2004-07-22 17:44:20.000000000 +0200
2516 + * Copyright (c) 2001 Caldera Deutschland GmbH.
2517 + * All rights reserved.
2519 + * This program is free software; you can redistribute it and/or modify
2520 + * it under the terms of the GNU General Public License as published by
2521 + * the Free Software Foundation; either version 2 of the License, or
2522 + * (at your option) any later version.
2524 + * This program is distributed in the hope that it will be useful,
2525 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2526 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2527 + * GNU General Public License for more details.
2529 + * You should have received a copy of the GNU General Public License
2530 + * aint32_t with this program; if not, write to the Free Software
2531 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2537 + * SCO OpenServer xstat/fxstat/lxstat support.
2539 +#include <linux/kernel.h>
2540 +#include <linux/fs.h>
2541 +#include <linux/sched.h>
2542 +#include <linux/file.h>
2543 +#include <linux/string.h>
2544 +#include <asm/uaccess.h>
2546 +#include <abi/sco/types.h>
2547 +#include <abi/sco/stat.h>
2548 +#include <abi/svr4/stat.h>
2550 +#include <abi/util/trace.h>
2551 +#include <abi/util/stat.h>
2554 +enum {SVR4_stat = 1, SCO_xstat = 51};
2557 +report_sco_xstat(struct kstat *stp, struct sco_xstat *bufp)
2559 + struct sco_xstat buf;
2561 + memset(&buf, 0, sizeof(struct sco_xstat));
2563 + buf.st_dev = linux_to_sco_dev_t(stp->dev);
2564 + buf.st_ino = linux_to_sco_ino_t(stp->ino);
2565 + buf.st_mode = stp->mode;
2566 + buf.st_nlink = stp->nlink;
2567 + buf.st_uid = linux_to_sco_uid_t(stp->uid);
2568 + buf.st_gid = linux_to_sco_gid_t(stp->gid);
2569 + buf.st_rdev = linux_to_sco_dev_t(stp->rdev);
2571 + if (stp->size > MAX_NON_LFS)
2572 + return -EOVERFLOW; /* XXX: what to return for SCO?? */
2574 + buf.st_size = stp->size;
2576 + buf.st_atime = stp->atime.tv_sec;
2577 + buf.st_mtime = stp->mtime.tv_sec;
2578 + buf.st_ctime = stp->ctime.tv_sec;
2580 + buf.st_blksize = stp->blksize;
2581 + buf.st_blocks = stp->blocks;
2583 + strcpy(buf.st_fstype, "ext2");
2585 + buf.st_sco_flags = 0; /* 1 if remote */
2587 + if (copy_to_user(bufp, &buf, sizeof(struct sco_xstat)))
2593 +sco_xstat(int vers, char *filename, void *bufp)
2598 + error = vfs_stat(filename, &st);
2604 + return report_svr4_stat(&st, bufp);
2606 + return report_sco_xstat(&st, bufp);
2609 +#if defined(CONFIG_ABI_TRACE)
2610 + abi_trace(ABI_TRACE_API, "xstat version %d not supported\n", vers);
2616 +sco_lxstat(int vers, char *filename, void *bufp)
2621 + error = vfs_lstat(filename, &st);
2627 + return report_svr4_stat(&st, bufp);
2629 + return report_sco_xstat(&st, bufp);
2632 +#if defined(CONFIG_ABI_TRACE)
2633 + abi_trace(ABI_TRACE_API, "lxstat version %d not supported\n", vers);
2639 +sco_fxstat(int vers, int fd, void *bufp)
2644 + error = vfs_fstat(fd, &st);
2650 + return report_svr4_stat(&st, bufp);
2652 + return report_sco_xstat(&st, bufp);
2655 +#if defined(CONFIG_ABI_TRACE)
2656 + abi_trace(ABI_TRACE_API, "fxstat version %d not supported\n", vers);
2660 diff -Nru linux-2.6.7/abi/sco/statvfs.c linux-2.6.7-abi/abi/sco/statvfs.c
2661 --- linux-2.6.7/abi/sco/statvfs.c 1970-01-01 01:00:00.000000000 +0100
2662 +++ linux-2.6.7-abi/abi/sco/statvfs.c 2004-07-22 17:44:20.000000000 +0200
2665 + * Copyright (c) 2001 Caldera Deutschland GmbH.
2666 + * Copyright (c) 2001 Christoph Hellwig.
2667 + * All rights reserved.
2669 + * This program is free software; you can redistribute it and/or modify
2670 + * it under the terms of the GNU General Public License as published by
2671 + * the Free Software Foundation; either version 2 of the License, or
2672 + * (at your option) any later version.
2674 + * This program is distributed in the hope that it will be useful,
2675 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2676 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2677 + * GNU General Public License for more details.
2679 + * You should have received a copy of the GNU General Public License
2680 + * along with this program; if not, write to the Free Software
2681 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2687 + * SCO OpenServer statvfs/fstatvfs support.
2689 +#include <linux/kernel.h>
2690 +#include <linux/fs.h>
2691 +#include <linux/sched.h>
2692 +#include <linux/file.h>
2693 +#include <linux/string.h>
2694 +#include <linux/vfs.h>
2695 +#include <linux/mount.h>
2696 +#include <linux/namei.h>
2697 +#include <asm/uaccess.h>
2699 +#include <abi/sco/types.h>
2703 +report_statvfs(struct vfsmount *mnt, struct inode *ip, struct sco_statvfs *bufp)
2705 + struct sco_statvfs buf;
2709 + error = vfs_statfs(mnt->mnt_sb, &s);
2713 + memset(&buf, 0, sizeof(struct sco_statvfs));
2715 + buf.f_bsize = s.f_bsize;
2716 + buf.f_frsize = s.f_bsize;
2717 + buf.f_blocks = s.f_blocks;
2718 + buf.f_bfree = s.f_bfree;
2719 + buf.f_bavail = s.f_bavail;
2720 + buf.f_files = s.f_files;
2721 + buf.f_free = s.f_ffree;
2722 + buf.f_favail = s.f_ffree; /* SCO addition in the middle! */
2723 + buf.f_sid = ip->i_sb->s_dev;
2726 + * Get the name of the filesystem.
2728 + * Sadly, some code "in the wild" actually checks the name
2729 + * against a hard coded list to see if it is a "real" fs or not.
2731 + * I believe Informix Dynamic Server for SCO is one such.
2733 + if (strncmp(ip->i_sb->s_type->name, "ext2", 4) == 0)
2734 + strcpy(buf.f_basetype, "HTFS");
2736 + strcpy(buf.f_basetype, ip->i_sb->s_type->name);
2738 + /* Check for a few flags statvfs wants but statfs doesn't have. */
2739 + if (IS_RDONLY(ip))
2741 + if (mnt->mnt_flags & MNT_NOSUID)
2744 + buf.f_namemax = s.f_namelen;
2746 + if (copy_to_user(bufp, &buf, sizeof(struct sco_statvfs)))
2752 +sco_statvfs(char *filename, struct sco_statvfs *bufp)
2754 + struct nameidata nd;
2757 + error = user_path_walk(filename, &nd);
2759 + error = report_statvfs(nd.mnt, nd.dentry->d_inode, bufp);
2760 + path_release(&nd);
2766 +sco_fstatvfs(int fd, struct sco_statvfs *bufp)
2769 + int error = -EBADF;
2773 + error = report_statvfs(fp->f_vfsmnt,
2774 + fp->f_dentry->d_inode, bufp);
2779 diff -Nru linux-2.6.7/abi/sco/sysent.c linux-2.6.7-abi/abi/sco/sysent.c
2780 --- linux-2.6.7/abi/sco/sysent.c 1970-01-01 01:00:00.000000000 +0100
2781 +++ linux-2.6.7-abi/abi/sco/sysent.c 2004-07-22 17:44:20.000000000 +0200
2784 + * Copyright (c) 2001 Christoph Hellwig.
2785 + * All rights reserved.
2787 + * This program is free software; you can redistribute it and/or modify
2788 + * it under the terms of the GNU General Public License as published by
2789 + * the Free Software Foundation; either version 2 of the License, or
2790 + * (at your option) any later version.
2792 + * This program is distributed in the hope that it will be useful,
2793 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2794 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2795 + * GNU General Public License for more details.
2797 + * You should have received a copy of the GNU General Public License
2798 + * along with this program; if not, write to the Free Software
2799 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2805 + * SCO Unix 3.x personality switch
2807 +#include <linux/kernel.h>
2808 +#include <linux/module.h>
2809 +#include <linux/init.h>
2810 +#include <linux/personality.h>
2811 +#include <linux/types.h>
2812 +#include <linux/syscalls.h>
2813 +#include <linux/socket.h>
2814 +#include <linux/net.h>
2815 +#include <asm/uaccess.h>
2817 +#include <abi/sco/signal.h>
2818 +#include <abi/sco/sysent.h>
2819 +#include <abi/svr4/sysent.h>
2820 +#include <abi/cxenix/sysent.h>
2822 +#include <abi/signal.h>
2824 +#include <abi/util/errno.h>
2825 +#include <abi/util/map.h>
2826 +#include <abi/util/sysent.h>
2827 +#include <abi/util/socket.h>
2830 +MODULE_DESCRIPTION("OpenServer/Xenix personality");
2831 +MODULE_AUTHOR("Christoph Hellwig, partially taken from iBCS");
2832 +MODULE_LICENSE("GPL");
2835 +static u_char sco_err_table[] = {
2836 +/* 0 - 9 */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
2837 +/* 10 - 19 */ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
2838 +/* 20 - 29 */ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
2839 +/* 30 - 39 */ 30, 31, 32, 33, 34, 45, 78, 46, 89, 145,
2840 +/* 40 - 49 */ 150, 90, 35, 36, 37, 38, 39, 40, 41, 42,
2841 +/* 50 - 59 */ 43, 44, 50, 51, 52, 53, 54, 55, 56, 57,
2842 +/* 60 - 69 */ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
2843 +/* 70 - 79 */ 70, 71, 74, 76, 77, 79, 80, 81, 82, 83,
2844 +/* 80 - 89 */ 84, 85, 86, 87, 88, 152, 153, 22, 93, 94,
2845 +/* 90 - 99 */ 95, 96, 118, 97, 98, 99, 100, 101, 102, 103,
2846 +/* 100 - 109 */ 104, 105, 106, 107, 108, 63, 110, 111, 112, 113,
2847 +/* 110 - 119 */ 114, 115, 116, 117, 92, 91, 151, 135, 137, 138,
2848 +/* 120 - 122 */ 139, 140, 28
2852 + * Map Linux RESTART* values (512,513,514) to EINTR
2854 +static u_char lnx_err_table[] = {
2855 +/* 512 - 514 */ EINTR, EINTR, EINTR
2858 +static struct map_segment sco_err_map[] = {
2859 + { 0, 0+sizeof(sco_err_table)-1, sco_err_table },
2860 + { 512, 512+sizeof(lnx_err_table)-1, lnx_err_table },
2864 +/* XXX: move to signal.h */
2865 +#define SCO__SIGSTKFLT SCO_SIGTERM /* Stack fault */
2867 +static long linux_to_sco_signals[NSIGNALS + 1] = {
2868 +/* 0 - 3 */ 0, SCO_SIGHUP, SCO_SIGINT, SCO_SIGQUIT,
2869 +/* 4 - 7 */ SCO_SIGILL, SCO_SIGTRAP, SCO_SIGABRT, SCO_SIGBUS,
2870 +/* 8 - 11 */ SCO_SIGFPE, SCO_SIGKILL, SCO_SIGUSR1, SCO_SIGSEGV,
2871 +/* 12 - 15 */ SCO_SIGUSR2, SCO_SIGPIPE, SCO_SIGALRM, SCO_SIGTERM,
2872 +/* 16 - 19 */ SCO__SIGSTKFLT, SCO_SIGCLD, SCO_SIGCONT, SCO_SIGSTOP,
2873 +/* 20 - 23 */ SCO_SIGTSTP, SCO_SIGTTIN, SCO_SIGTTOU, SCO_SIGURG,
2874 +/* 24 - 27 */ SCO_SIGXCPU, SCO_SIGXFSZ, SCO_SIGVTALRM, SCO_SIGPROF,
2875 +/* 28 - 31 */ SCO_SIGWINCH, SCO_SIGPOLL, SCO_SIGPWR, SCO_SIGSYS,
2879 +static long linux_to_xenix_signals[NSIGNALS+1] = {
2880 +/* 0 - 3 */ 0, IBCS_SIGHUP, IBCS_SIGINT, IBCS_SIGQUIT,
2881 +/* 4 - 7 */ IBCS_SIGILL, IBCS_SIGTRAP, IBCS_SIGABRT, -1,
2882 +/* 8 - 11 */ IBCS_SIGFPE, IBCS_SIGKILL, IBCS_SIGUSR1, IBCS_SIGSEGV,
2883 +/* 12 - 15 */ IBCS_SIGUSR2, IBCS_SIGPIPE, IBCS_SIGALRM, IBCS_SIGTERM,
2884 +/* 16 - 19 */ IBCS_SIGSEGV, IBCS_SIGCHLD, IBCS_SIGCONT, IBCS_SIGSTOP,
2885 +/* 20 - 23 */ IBCS_SIGTSTP, IBCS_SIGTTIN, IBCS_SIGTTOU, IBCS_SIGUSR1,
2886 +/* 24 - 27 */ IBCS_SIGGXCPU, IBCS_SIGGXFSZ, IBCS_SIGVTALRM, IBCS_SIGPROF,
2887 +/* 28 - 31 */ IBCS_SIGWINCH, 20 /*SIGIO*/, IBCS_SIGPWR, -1,
2891 +static long sco_to_linux_signals[NSIGNALS+1] = {
2892 +/* 0 - 3 */ 0, SIGHUP, SIGINT, SIGQUIT,
2893 +/* 4 - 7 */ SIGILL, SIGTRAP, SIGIOT, SIGABRT,
2894 +/* 8 - 11 */ SIGFPE, SIGKILL, SIGBUS, SIGSEGV,
2895 +/* 12 - 15 */ SIGSYS, SIGPIPE, SIGALRM, SIGTERM,
2896 +/* 16 - 19 */ SIGUSR1, SIGUSR2, SIGCHLD, SIGPWR,
2897 +/* 20 - 23 */ SIGWINCH, SIGURG, SIGPOLL, SIGSTOP,
2898 +/* 24 - 27 */ SIGTSTP, SIGCONT, SIGTTIN, SIGTTOU,
2899 +/* 28 - 31 */ SIGVTALRM, SIGPROF, SIGXCPU, SIGXFSZ,
2903 +static long xenix_to_linux_signals[NSIGNALS+1] = {
2904 +/* 0 - 3 */ 0, SIGHUP, SIGINT, SIGQUIT,
2905 +/* 4 - 7 */ SIGILL, SIGTRAP, SIGIOT, SIGUNUSED,
2906 +/* 8 - 11 */ SIGFPE, SIGKILL, SIGUNUSED, SIGSEGV,
2907 +/* 12 - 15 */ SIGUNUSED, SIGPIPE, SIGALRM, SIGTERM,
2908 +/* 16 - 19 */ SIGUSR1, SIGUSR2, SIGCHLD, SIGPWR,
2909 +/* 20 - 23 */ SIGPOLL, -1, -1, -1,
2910 +/* 24 - 27 */ -1, -1, -1, -1,
2911 +/* 28 - 31 */ -1, -1, -1, -1,
2915 +static char sco_socktype[] = {
2924 +static struct map_segment sco_socktype_map[] = {
2925 + { 1, 6, sco_socktype },
2929 +static struct map_segment sco_sockopt_map[] = {
2930 + { 0x0001, 0x0001, (char *)SO_DEBUG },
2931 + { 0x0002, 0x0002, (char *)__SO_ACCEPTCON },
2932 + { 0x0004, 0x0004, (char *)SO_REUSEADDR },
2933 + { 0x0008, 0x0008, (char *)SO_KEEPALIVE },
2934 + { 0x0010, 0x0010, (char *)SO_DONTROUTE },
2935 + { 0x0020, 0x0020, (char *)SO_BROADCAST },
2936 + { 0x0040, 0x0040, (char *)SO_USELOOPBACK },
2937 + { 0x0080, 0x0080, (char *)SO_LINGER },
2938 + { 0x0100, 0x0100, (char *)SO_OOBINLINE },
2939 + { 0x0200, 0x0200, (char *)SO_ORDREL },
2940 + { 0x0400, 0x0400, (char *)SO_IMASOCKET },
2941 + { 0x1001, 0x1001, (char *)SO_SNDBUF },
2942 + { 0x1002, 0x1002, (char *)SO_RCVBUF },
2943 + { 0x1003, 0x1003, (char *)SO_SNDLOWAT },
2944 + { 0x1004, 0x1004, (char *)SO_RCVLOWAT },
2945 + { 0x1005, 0x1005, (char *)SO_SNDTIMEO },
2946 + { 0x1006, 0x1006, (char *)SO_RCVTIMEO },
2947 + { 0x1007, 0x1007, (char *)SO_ERROR },
2948 + { 0x1008, 0x1008, (char *)SO_TYPE },
2949 + { 0x1009, 0x1009, (char *)SO_PROTOTYPE },
2954 + * The first three entries (AF_UNSPEC, AF_UNIX and AF_INET)
2955 + * are identity mapped. All others aren't available under
2956 + * Linux, nor are Linux's AF_AX25 and AF_IPX available from
2957 + * SCO as far as I know.
2959 +static struct map_segment sco_af_map[] = {
2965 +static struct sysent sco_syscall_table[] = {
2966 +/* 0 */ { abi_syscall, Fast, "syscall", "" },
2967 +/* 1 */ { sys_exit, 1, "exit", "d" },
2968 +/* 2 */ { abi_fork, Spl, "fork", "" },
2969 +/* 3 */ { abi_read, 3, "read", "dpd" },
2970 +/* 4 */ { sys_write, 3, "write", "dpd" },
2971 +/* 5 */ { svr4_open, 3, "open", "soo" },
2972 +/* 6 */ { sys_close, 1, "close", "d" },
2973 +/* 7 */ { abi_wait, Spl, "wait", "xxx" },
2974 +/* 8 */ { sys_creat, 2, "creat", "so" },
2975 +/* 9 */ { sys_link, 2, "link", "ss" },
2976 +/* 10 */ { sys_unlink, 1, "unlink", "s" },
2977 +/* 11 */ { abi_exec, Spl, "exec", "sxx" },
2978 +/* 12 */ { sys_chdir, 1, "chdir", "s" },
2979 +/* 13 */ { abi_time, 0, "time", "" },
2980 +/* 14 */ { svr4_mknod, 3, "mknod", "soo" },
2981 +/* 15 */ { sys_chmod, 2, "chmod", "so" },
2982 +/* 16 */ { sys_chown, 3, "chown", "sdd" },
2983 +/* 17 */ { abi_brk, 1, "brk/break", "x" },
2984 +/* 18 */ { svr4_stat, 2, "stat", "sp" },
2985 +/* 19 */ { sco_lseek, 3, "seek/lseek", "ddd" },
2986 +/* 20 */ { abi_getpid, Spl, "getpid", "" },
2987 +/* 21 */ { 0, Ukn, "mount", "" },
2988 +/* 22 */ { sys_umount, 1, "umount", "s" },
2989 +/* 23 */ { sys_setuid, 1, "setuid", "d" },
2990 +/* 24 */ { abi_getuid, Spl, "getuid", "" },
2991 +/* 25 */ { sys_stime, 1, "stime", "d" },
2992 +/* 26 */ { sco_ptrace, 4, "ptrace", "xdxx" },
2993 +/* 27 */ { sys_alarm, 1, "alarm", "d" },
2994 +/* 28 */ { svr4_fstat, 2, "fstat", "dp" },
2995 +/* 29 */ { sys_pause, 0, "pause", "" },
2996 +/* 30 */ { sys_utime, 2, "utime", "xx" },
2997 +/* 31 */ { 0, Ukn, "stty", "" },
2998 +/* 32 */ { 0, Ukn, "gtty", "" },
2999 +/* 33 */ { sys_access, 2, "access", "so" },
3000 +/* 34 */ { sys_nice, 1, "nice", "d" },
3001 +/* 35 */ { svr4_statfs, 4, "statfs", "spdd" },
3002 +/* 36 */ { sys_sync, 0, "sync", "" },
3003 +/* 37 */ { abi_kill, 2, "kill", "dd" },
3004 +/* 38 */ { svr4_fstatfs, 4, "fstatfs", "dpdd" },
3005 +/* 39 */ { abi_procids, Spl, "procids", "d" },
3006 +/* 40 */ { cxenix, Fast, "cxenix", "" },
3007 +/* 41 */ { sys_dup, 1, "dup", "d" },
3008 +/* 42 */ { abi_pipe, Spl, "pipe", "" },
3009 +/* 43 */ { sys_times, 1, "times", "p" },
3010 +/* 44 */ { 0 , Ukn, "prof", "" },
3011 +/* 45 */ { 0, Ukn, "lock/plock", "" },
3012 +/* 46 */ { sys_setgid, 1, "setgid", "d" },
3013 +/* 47 */ { abi_getgid, Spl, "getgid", "" },
3014 +/* 48 */ { abi_sigfunc, Fast, "sigfunc", "xxx" },
3015 +/* 49 */ { svr4_msgsys, Spl, "msgsys", "dxddd" },
3016 +/* 50 */ { sco_sysi86, 3, "sysi86/sys3b", "d" },
3017 +/* 51 */ { sys_acct, 1, "acct/sysacct", "x" },
3018 +/* 52 */ { svr4_shmsys, Fast, "shmsys", "ddxo" },
3019 +/* 53 */ { svr4_semsys, Spl, "semsys", "dddx" },
3020 +/* 54 */ { sco_ioctl, Spl, "ioctl", "dxx" },
3021 +/* 55 */ { 0, 3, "uadmin", "xxx" },
3022 +/* 56 */ { 0, Ukn, "?", "" },
3023 +/* 57 */ { v7_utsname, 1, "utsys", "x" },
3024 +/* 58 */ { sys_fsync, 1, "fsync", "d" },
3025 +/* 59 */ { abi_exec, Spl, "execv", "spp" },
3026 +/* 60 */ { sys_umask, 1, "umask", "o" },
3027 +/* 61 */ { sys_chroot, 1, "chroot", "s" },
3028 +/* 62 */ { sco_fcntl, 3, "fcntl", "dxx" },
3029 +/* 63 */ { svr4_ulimit, 2, "ulimit", "xx" },
3030 +/* 64 */ { 0, Ukn, "?", "" },
3031 +/* 65 */ { 0, Ukn, "?", "" },
3032 +/* 66 */ { 0, Ukn, "?", "" },
3033 +/* 67 */ { 0, Ukn, "?", "" },
3034 +/* 68 */ { 0, Ukn, "?", "" },
3035 +/* 69 */ { 0, Ukn, "?", "" },
3036 +/* 70 */ { 0, Ukn, "advfs", "" },
3037 +/* 71 */ { 0, Ukn, "unadvfs", "" },
3038 +/* 72 */ { 0, Ukn, "rmount", "" },
3039 +/* 73 */ { 0, Ukn, "rumount", "" },
3040 +/* 74 */ { 0, Ukn, "rfstart", "" },
3041 +/* 75 */ { 0, Ukn, "?", "" },
3042 +/* 76 */ { 0, Ukn, "rdebug", "" },
3043 +/* 77 */ { 0, Ukn, "rfstop", "" },
3044 +/* 78 */ { 0, Ukn, "rfsys", "" },
3045 +/* 79 */ { sys_rmdir, 1, "rmdir", "s" },
3046 +/* 80 */ { abi_mkdir, 2, "mkdir", "so" },
3047 +/* 81 */ { svr4_getdents, 3, "getdents", "dxd" },
3048 +/* 82 */ { 0, Ukn, "libattach", "" },
3049 +/* 83 */ { 0, Ukn, "libdetach", "" },
3050 +/* 84 */ { svr4_sysfs, 3, "sysfs", "dxx" },
3051 +/* 85 */ { svr4_getmsg, Spl, "getmsg", "dxxx" },
3052 +/* 86 */ { svr4_putmsg, Spl, "putmsg", "dxxd" },
3053 +/* 87 */ { sys_poll, 3, "poll", "xdd" },
3054 +/* 88 */ { 0, Ukn, "nosys88", "" },
3055 +/* 89 */ { sw_security, 6, "security", "dxxxxx"},
3056 +/* 90 */ { sys_symlink, 2, "symlink", "ss" },
3057 +/* 91 */ { svr4_lstat, 2, "lstat", "sp" },
3058 +/* 92 */ { sys_readlink, 3, "readlink", "spd" },
3061 + * Ok, this is where the good-old SCO calls end.
3062 + * Everything from here onwards is OSR5-specific.
3064 + * In fact OSR5 documents only the following calls:
3072 + * o gettimeofday (171)
3073 + * o settimeofday (172)
3075 + * Everything else is guesswork (from AVR4/iABI4), even though
3076 + * the OSR5 ELF libs use at least some of those... (e.g. mmap).
3079 +/* 93 */ { 0, Ukn, "?", "" },
3080 +/* 94 */ { 0, Ukn, "?", "" },
3081 +/* 95 */ { abi_sigprocmask, 3, "sigprocmask", "dxx" },
3082 +/* 96 */ { abi_sigsuspend, Spl, "sigsuspend", "x" },
3083 +/* 97 */ { 0, 2, "sigaltstack", "xx" },
3084 +/* 98 */ { abi_sigaction, 3, "sigaction", "dxx" },
3085 +/* 99 */ { svr4_sigpending, 2, "sigpending", "dp" },
3086 +/* 100 */ { svr4_context, Spl, "context", "" },
3087 +/* 101 */ { 0, Ukn, "evsys", "" },
3088 +/* 102 */ { 0, Ukn, "evtrapret", "" },
3089 +/* 103 */ { sco_statvfs, 2, "statvfs", "sp" },
3090 +/* 104 */ { sco_fstatvfs, 2, "fstatvfs", "dp" },
3091 +/* 105 */ { 0, Ukn, "unimp (sysisc)","" },
3092 +/* 106 */ { 0, Ukn, "nfssys", "" },
3093 +/* 107 */ { 0, 4, "waitid", "ddxd" },
3094 +/* 108 */ { 0, 3, "sigsendsys", "ddd" },
3095 +/* 109 */ { svr4_hrtsys, Spl, "hrtsys", "xxx" },
3096 +/* 110 */ { 0, 3, "acancel", "dxd" },
3097 +/* 111 */ { 0, Ukn, "async", "" },
3098 +/* 112 */ { 0, Ukn, "priocntlsys", "" },
3099 +/* 113 */ { svr4_pathconf, 2, "pathconf", "sd" },
3100 +/* 114 */ { sys_mincore, 3, "mincore", "xdx" },
3101 +/* 115 */ { sco_mmap, 6, "mmap", "xxxxdx"},
3102 +/* 116 */ { sys_mprotect, 3, "mprotect", "xdx" },
3103 +/* 117 */ { sys_munmap, 2, "munmap", "xd" },
3104 +/* 118 */ { svr4_fpathconf, 2, "fpathconf", "dd" },
3105 +/* 119 */ { abi_fork, Spl, "vfork", "" },
3106 +/* 120 */ { sys_fchdir, 1, "fchdir", "d" },
3107 +/* 121 */ { sys_readv, 3, "readv", "dxd" },
3108 +/* 122 */ { sys_writev, 3, "writev", "dxd" },
3109 +/* 123 */ { sco_xstat, 3, "xstat", "dsx" },
3110 +/* 124 */ { sco_lxstat, 3, "lxstat", "dsx" },
3111 +/* 125 */ { sco_fxstat, 3, "fxstat", "ddx" },
3112 +/* 126 */ { svr4_xmknod, 4, "xmknod", "dsox" },
3113 +/* 127 */ { 0, Ukn, "syslocal", "d" },
3114 +/* 128 */ { svr4_getrlimit, 2, "setrlimit", "dx" },
3115 +/* 129 */ { svr4_setrlimit, 2, "getrlimit", "dx" },
3116 +/* 130 */ { 0, Ukn, "?", "" },
3117 +/* 131 */ { 0, Ukn, "?", "" },
3118 +/* 132 */ { 0, Ukn, "?", "" },
3119 +/* 133 */ { 0, Ukn, "?", "" },
3120 +/* 134 */ { 0, Ukn, "?", "" },
3121 +/* 135 */ { 0, Ukn, "?", "" },
3122 +/* 136 */ { 0, Ukn, "?", "" },
3123 +/* 137 */ { 0, Ukn, "?", "" },
3124 +/* 138 */ { 0, Ukn, "?", "" },
3125 +/* 139 */ { 0, Ukn, "?", "" },
3126 +/* 140 */ { socksys_syscall, 1, "socksys", "x" },
3127 +/* 141 */ { 0, Ukn, "?", "" },
3128 +/* 142 */ { 0, Ukn, "?", "" },
3129 +/* 143 */ { 0, Ukn, "?", "" },
3132 + * The next three are used when an OSR5 app is launched by
3133 + * a UnixWare libc.
3135 + * These aren't supported by the UW7 personality either, but
3136 + * adding the names here makes the traces look saner.
3139 +/* 144 */ { 0, 2, "uw7-secsys", "dx" },
3140 +/* 145 */ { 0, 4, "uw7-filepriv", "sdxd" },
3141 +/* 146 */ { 0, 3, "uw7-procpriv", "dxd" },
3143 +/* 147 */ { 0, Ukn, "?", "" },
3144 +/* 148 */ { 0, Ukn, "?", "" },
3145 +/* 149 */ { 0, Ukn, "?", "" },
3146 +/* 150 */ { 0, Ukn, "?", "" },
3147 +/* 151 */ { 0, Ukn, "?", "" },
3148 +/* 152 */ { 0, Ukn, "?", "" },
3149 +/* 153 */ { 0, Ukn, "?", "" },
3150 +/* 154 */ { 0, Ukn, "?", "" },
3151 +/* 155 */ { 0, Ukn, "?", "" },
3152 +/* 156 */ { 0, Ukn, "?", "" },
3153 +/* 157 */ { 0, Ukn, "?", "" },
3154 +/* 158 */ { 0, Ukn, "?", "" },
3155 +/* 159 */ { 0, Ukn, "?", "" },
3156 +/* 160 */ { 0, Ukn, "?", "" },
3157 +/* 161 */ { 0, Ukn, "?", "" },
3158 +/* 162 */ { 0, Ukn, "?", "" },
3159 +/* 163 */ { 0, Ukn, "?", "" },
3160 +/* 164 */ { 0, Ukn, "?", "" },
3161 +/* 165 */ { 0, Ukn, "?", "" },
3162 +/* 166 */ { 0, Ukn, "?", "" },
3163 +/* 167 */ { 0, Ukn, "?", "" },
3164 +/* 168 */ { 0, Ukn, "?", "" },
3165 +/* 169 */ { 0, Ukn, "?", "" },
3166 +/* 170 */ { 0, Ukn, "?", "" },
3167 +/* 171 */ { sys_gettimeofday, 2, "gettimeofday", "xx" },
3168 +/* 172 */ { sys_settimeofday, 2, "settimeofday", "xx" },
3172 +sco_lcall7(int segment, struct pt_regs *regs)
3174 + int sysno = regs->eax & 0xff;
3176 + if (sysno >= ARRAY_SIZE(sco_syscall_table))
3177 + set_error(regs, iABI_errors(-EINVAL));
3179 + lcall7_dispatch(regs, &sco_syscall_table[sysno], 1);
3183 +static struct exec_domain sco_exec_domain = {
3184 + name: "OpenServer",
3185 + handler: sco_lcall7,
3186 + pers_low: 3 /* PER_SCOSVR3, PER_OSR5 */,
3187 + pers_high: 3 /* PER_SCOSVR3, PER_OSR5 */,
3188 + signal_map: sco_to_linux_signals,
3189 + signal_invmap: linux_to_sco_signals,
3190 + err_map: sco_err_map,
3191 + socktype_map: sco_socktype_map,
3192 + sockopt_map: sco_sockopt_map,
3193 + af_map: sco_af_map,
3194 + module: THIS_MODULE
3197 +static struct exec_domain xenix_exec_domain = {
3199 + handler: sco_lcall7,
3200 + pers_low: 7 /* PER_XENIX */,
3201 + pers_high: 7 /* PER_XENIX */,
3202 + signal_map: xenix_to_linux_signals,
3203 + signal_invmap: linux_to_xenix_signals,
3204 + err_map: sco_err_map,
3205 + socktype_map: sco_socktype_map,
3206 + sockopt_map: sco_sockopt_map,
3207 + af_map: sco_af_map,
3208 + module: THIS_MODULE
3213 +sco_module_init(void)
3217 + err = register_exec_domain(&sco_exec_domain);
3222 + err = register_exec_domain(&xenix_exec_domain);
3224 + unregister_exec_domain(&sco_exec_domain);
3232 +sco_module_exit(void)
3234 + unregister_exec_domain(&xenix_exec_domain);
3235 + unregister_exec_domain(&sco_exec_domain);
3238 +module_init(sco_module_init);
3239 +module_exit(sco_module_exit);
3240 diff -Nru linux-2.6.7/abi/sco/tapeio.c linux-2.6.7-abi/abi/sco/tapeio.c
3241 --- linux-2.6.7/abi/sco/tapeio.c 1970-01-01 01:00:00.000000000 +0100
3242 +++ linux-2.6.7-abi/abi/sco/tapeio.c 2004-07-22 17:44:20.000000000 +0200
3246 +#include <linux/kernel.h>
3247 +#include <linux/mtio.h>
3248 +#include <linux/unistd.h>
3249 +#include <linux/syscalls.h>
3251 +#include <asm/uaccess.h>
3255 +sco_tape_ioctl(int fd, u_int cmd, caddr_t data)
3261 + mtop.mt_count = 1;
3263 + switch (cmd & 0xff) {
3264 + case 1: /* MT_RESET */
3265 + mtop.mt_op = MTRESET;
3268 + case 2: /* MT_RETEN */
3269 + mtop.mt_op = MTRETEN;
3272 + case 3: /* MT_REWIND */
3273 + mtop.mt_op = MTREW;
3276 + case 4: /* MT_ERASE */
3277 + case 23: /* HP_ERASE */
3278 + mtop.mt_op = MTERASE;
3281 + case 6: /* MT_RFM */
3282 + mtop.mt_op = MTFSF;
3285 + case 7: /* MT_WFM */
3286 + mtop.mt_op = MTWEOF;
3289 + case 8: /* MT_LOAD */
3290 + mtop.mt_op = MTLOAD;
3293 + case 9: /* MT_UNLOAD */
3294 + mtop.mt_op = MTOFFL;
3297 + case 19: /* MT_RSM */
3298 + mtop.mt_op = MTFSS;
3301 + case 20: /* MT_WSM */
3302 + mtop.mt_op = MTWSM;
3305 + case 21: /* MT_EOD */
3306 + mtop.mt_op = MTEOM;
3309 + case 24: /* MT_SETBLK */
3310 + mtop.mt_op = MTSETBLK;
3311 + mtop.mt_count = (int)data;
3314 + case 25: /* MT_LOCK */
3315 + mtop.mt_op = MTLOCK;
3318 + case 26: /* MT_UNLOCK */
3319 + mtop.mt_op = MTUNLOCK;
3325 + The following function codes are just copied from the SCO
3329 + case 0: /* MT_STATUS */
3330 + case 5: /* MT_AMOUNT */
3331 + case 10: /* MT_DSTATUS */
3332 + case 11: /* MT_FORMAT */
3333 + case 12: /* MT_GETHDR */
3334 + case 13: /* MT_PUTHDR */
3335 + case 14: /* MT_GETNEWBB */
3336 + case 15: /* MT_PUTNEWBB */
3337 + case 16: /* MT_GETVTBL */
3338 + case 17: /* MT_PUTVTBL */
3339 + case 18: /* MT_SERVO */
3340 + case 22: /* MT_FORMPART */
3341 + case 38: /* MT_SETANSI */
3342 + case 64: /* MT_REPORT */
3345 + printk (KERN_ERR "abi: SCO tape ioctl func=%d arg=%x unsupported\n",
3346 + cmd & 0xff, (int)data);
3352 + error = sys_ioctl(fd, MTIOCTOP, (long)&mtop);
3356 diff -Nru linux-2.6.7/abi/sco/termios.c linux-2.6.7-abi/abi/sco/termios.c
3357 --- linux-2.6.7/abi/sco/termios.c 1970-01-01 01:00:00.000000000 +0100
3358 +++ linux-2.6.7-abi/abi/sco/termios.c 2004-07-22 17:44:20.000000000 +0200
3361 + * Copyright (C) 1991, 1992 Linus Torvalds
3363 + * Written by Drew Sullivan.
3364 + * Rewritten by Mike Jagdis.
3369 +#include <linux/errno.h>
3370 +#include <linux/kernel.h>
3371 +#include <linux/termios.h>
3372 +#include <linux/unistd.h>
3373 +#include <linux/syscalls.h>
3374 +#include <asm/uaccess.h>
3376 +#include <abi/svr4/ioctl.h>
3377 +#include <abi/svr4/termios.h>
3380 +#define SCO_NCCS (SVR_NCC+5)
3382 +struct sco_termios {
3383 + u_int16_t c_iflag;
3384 + u_int16_t c_oflag;
3385 + u_int16_t c_cflag;
3386 + u_int16_t c_lflag;
3388 + u_char c_cc[SCO_NCCS];
3394 +sco_to_linux_termios(int fd, int op, struct sco_termios *it)
3397 + mm_segment_t old_fs;
3399 + char sco_cc[SCO_NCCS];
3402 + error = verify_area(VERIFY_READ, it, sizeof(struct sco_termios));
3406 + old_fs = get_fs();
3408 + error = sys_ioctl(fd, TCGETS, (long)&t);
3414 + __get_user(t.c_iflag, &it->c_iflag);
3415 + t.c_iflag &= ~0100000; /* DOSMODE */
3417 + __get_user(t.c_oflag, &it->c_oflag);
3419 + __get_user(t.c_cflag, &it->c_cflag);
3420 + if (t.c_cflag & 0100000) /* CRTSFL - SCO only? */
3421 + t.c_cflag |= CRTSCTS;
3422 + t.c_cflag &= ~0170000; /* LOBLK|CTSFLOW|RTSFLOW|CRTSFL */
3424 + lflag = t.c_lflag;
3425 + t.c_lflag &= ~0100777;
3426 + __get_user(r, &it->c_lflag);
3429 + if ((t.c_lflag & 0100000))
3430 + sys_ioctl(fd, TIOCEXCL, 0);
3432 + sys_ioctl(fd, TIOCNXCL, 0);
3434 + t.c_lflag &= ~0100000;
3435 + t.c_lflag |= (t.c_lflag & 0000400) << 7; /* Move IEXTEN */
3436 + t.c_lflag &= ~0000400;
3437 + t.c_lflag |= (t.c_lflag & 0001000) >> 1; /* Move TOSTOP */
3438 + t.c_lflag &= ~0001000;
3439 + t.c_lflag |= (lflag & 0001000); /* Restore ECHOCTL */
3441 + __get_user(t.c_line, &it->c_line); /* XXX Map this? */
3443 + copy_from_user(sco_cc, &it->c_cc, SCO_NCCS);
3444 + t.c_cc[0] = sco_cc[0];
3445 + t.c_cc[1] = sco_cc[1];
3446 + t.c_cc[2] = sco_cc[2];
3447 + t.c_cc[3] = sco_cc[3];
3448 + t.c_cc[7] = sco_cc[7];
3449 + t.c_cc[8] = sco_cc[11];
3450 + t.c_cc[9] = sco_cc[12];
3451 + t.c_cc[10] = sco_cc[10];
3452 + t.c_cc[16] = sco_cc[6];
3453 + if (t.c_lflag & ICANON) {
3454 + t.c_cc[4] = sco_cc[4];
3455 + t.c_cc[11] = sco_cc[5];
3457 + t.c_cc[4] = sco_cc[8];
3458 + t.c_cc[5] = sco_cc[5];
3459 + t.c_cc[6] = sco_cc[4];
3460 + t.c_cc[11] = sco_cc[9];
3464 + error = sys_ioctl(fd, op, (long)&t);
3471 +linux_to_sco_termios(int fd, int op, struct sco_termios *it)
3474 + char sco_cc[SCO_NCCS];
3475 + mm_segment_t old_fs;
3478 + error = verify_area(VERIFY_WRITE, it, sizeof(struct sco_termios));
3482 + old_fs = get_fs();
3484 + error = sys_ioctl(fd, op, (long)&t);
3489 + put_user(t.c_iflag & 0017777, &it->c_iflag);
3491 + put_user(t.c_oflag & 0177777, &it->c_oflag);
3493 + if (t.c_cflag & CRTSCTS)
3494 + t.c_cflag |= 0100000; /* CRTSFL - SCO only? */
3495 + put_user(t.c_cflag & 0177777, &it->c_cflag);
3497 + t.c_lflag &= ~0001000;
3498 + t.c_lflag |= (t.c_lflag & 0000400) << 1;
3499 + t.c_lflag &= ~0000400;
3500 + t.c_lflag |= (t.c_lflag & 0100000) >> 7;
3501 + t.c_lflag &= ~0100000;
3502 + put_user(t.c_lflag & 0001777, &it->c_lflag);
3504 + put_user(t.c_line, &it->c_line); /* XXX Map this? */
3506 + sco_cc[0] = t.c_cc[0];
3507 + sco_cc[1] = t.c_cc[1];
3508 + sco_cc[2] = t.c_cc[2];
3509 + sco_cc[3] = t.c_cc[3];
3510 + sco_cc[6] = t.c_cc[16];
3511 + sco_cc[7] = t.c_cc[7];
3512 + sco_cc[8] = t.c_cc[4];
3513 + sco_cc[9] = t.c_cc[11];
3514 + sco_cc[10] = t.c_cc[10];
3515 + sco_cc[11] = t.c_cc[8];
3516 + sco_cc[12] = t.c_cc[9];
3517 + if (t.c_lflag & ICANON) {
3518 + sco_cc[4] = t.c_cc[4];
3519 + sco_cc[5] = t.c_cc[11];
3521 + sco_cc[4] = t.c_cc[6];
3522 + sco_cc[5] = t.c_cc[5];
3525 + copy_to_user(&it->c_cc, sco_cc, SCO_NCCS);
3531 +sco_term_ioctl(int fd, unsigned int func, void *arg)
3534 + case 1: /* XCGETA */
3535 + return linux_to_sco_termios(fd, TCGETS, arg);
3536 + case 2: /* XCSETA */
3537 + return sco_to_linux_termios(fd, TCSETS, arg);
3538 + case 3: /* XCSETAW */
3539 + return sco_to_linux_termios(fd, TCSETSW, arg);
3540 + case 4: /* XCSETAF */
3541 + return sco_to_linux_termios(fd, TCSETSF, arg);
3543 + printk(KERN_ERR "iBCS: SCO termios ioctl %d unsupported\n", func);
3546 diff -Nru linux-2.6.7/abi/sco/vtkbd.c linux-2.6.7-abi/abi/sco/vtkbd.c
3547 --- linux-2.6.7/abi/sco/vtkbd.c 1970-01-01 01:00:00.000000000 +0100
3548 +++ linux-2.6.7-abi/abi/sco/vtkbd.c 2004-07-22 17:44:20.000000000 +0200
3551 + * This provides internal emulation support for the SCO <sys/vtkd.h> on
3552 + * the multiscreen console. More or less, this involves translating the
3553 + * input ioctl()'s into a similar Linux ioctl()'s.
3555 + * Not emulated SCO multiscreen functions:
3558 + * Not emulated SCO keyboard functions:
3559 + * KIOCDOSMODE set DOSMODE
3560 + * KIOCNONDOSMODE unset DOSMODE
3561 + * KDDISPINFO get display start and size
3562 + * KDGKBSTATE get state of keyboard shift keys
3564 + * Written by Scott Michel, scottm@intime.com
3565 + * (c) 1994 Scott Michel as part of the Linux iBCS-2 emulator project.
3570 +#include <linux/errno.h>
3571 +#include <linux/kernel.h>
3572 +#include <linux/vt.h>
3573 +#include <linux/kd.h>
3574 +#include <linux/syscalls.h>
3575 +#include <asm/uaccess.h>
3579 + int in; /* only lower 8 bits */
3580 + int out; /* Linux version */
3583 + { 1, KDDISPTYPE },
3586 + { 3, KDUNMAPDISP },
3591 + { 10, KDSETMODE },
3595 + { 61, KDDISABIO },
3599 + { 63, KIOCSOUND },
3600 + { 64, KDGKBTYPE },
3607 +sco_vtkbd_ioctl(int fd, u_int cmd, caddr_t data)
3609 + u_int gen = (cmd >> 8) & 0xff;
3610 + u_int spec = cmd & 0xff;
3616 + * Could make this translation process table based, but, why
3617 + * waste the valuable kernel space ?
3620 + newf = (spec == 1 ? VT_OPENQRY :
3621 + (spec == 2 ? VT_SETMODE :
3622 + (spec == 3 ? VT_GETMODE :
3623 + (spec == 4 ? VT_RELDISP :
3624 + (spec == 5 ? VT_ACTIVATE : -1)))));
3626 + return sys_ioctl(fd, newf, (long)data);
3629 + for (i = 0; i < ARRAY_SIZE(trantab); i++) {
3630 + if (spec == trantab[i].in)
3631 + return sys_ioctl(fd, trantab[i].out, (long)data);
3635 + printk(KERN_ERR "%s: vtkd ioctl 0x%02x unsupported\n", __FILE__, cmd);
3638 diff -Nru linux-2.6.7/abi/solaris/lfs.c linux-2.6.7-abi/abi/solaris/lfs.c
3639 --- linux-2.6.7/abi/solaris/lfs.c 1970-01-01 01:00:00.000000000 +0100
3640 +++ linux-2.6.7-abi/abi/solaris/lfs.c 2004-07-22 17:44:20.000000000 +0200
3643 + * Solaris Large File Summit support
3648 +#include <linux/errno.h>
3649 +#include <linux/stat.h>
3650 +#include <linux/fs.h>
3651 +#include <linux/sched.h>
3652 +#include <linux/kernel.h>
3653 +#include <linux/mm.h>
3654 +#include <linux/file.h>
3655 +#include <linux/slab.h>
3656 +#include <linux/mman.h>
3657 +#include <linux/net.h>
3658 +#include <linux/socket.h>
3659 +#include <linux/un.h>
3660 +#include <linux/dirent.h>
3661 +#include <linux/syscalls.h>
3662 +#include <asm/uaccess.h>
3664 +#include <abi/util/map.h>
3665 +#include <abi/svr4/sysent.h>
3669 +sol_open64(const char *fname, int flag, int mode)
3673 + struct file *file;
3674 + mm_segment_t old_fs;
3676 + struct sockaddr_un addr;
3678 + fd = sys_open(fname, map_flags(flag, fl_svr4_to_linux) | O_LARGEFILE, mode);
3682 + /* Sometimes a program may open a pathname which it expects
3683 + * to be a named pipe (or STREAMS named pipe) when the
3684 + * Linux domain equivalent is a Unix domain socket. (e.g.
3685 + * UnixWare uses a STREAMS named pipe /dev/X/Nserver.0 for
3686 + * X :0 but Linux uses a Unix domain socket /tmp/.X11-unix/X0)
3687 + * It isn't enough just to make the symlink because you cannot
3688 + * open() a socket and read/write it. If we spot the error we can
3689 + * switch to socket(), connect() and things will likely work
3690 + * as expected however.
3694 + return fd; /* Huh?!? */
3695 + if (!S_ISSOCK(file->f_dentry->d_inode->i_mode)) {
3702 + args[0] = AF_UNIX;
3703 + args[1] = SOCK_STREAM;
3705 + old_fs = get_fs();
3707 + fd = sys_socketcall(SYS_SOCKET, args);
3712 + p = getname(fname);
3715 + return PTR_ERR(p);
3717 + if (strlen(p) >= UNIX_PATH_MAX) {
3722 + addr.sun_family = AF_UNIX;
3723 + strcpy(addr.sun_path, p);
3727 + args[1] = (int)&addr;
3728 + args[2] = sizeof(struct sockaddr_un);
3730 + error = sys_socketcall(SYS_CONNECT, args);
3741 +struct sol_dirent64 {
3742 + unsigned long long d_ino;
3743 + unsigned long long d_off;
3744 + unsigned short d_reclen;
3749 +/* If/when the readdir function is changed to read multiple entries
3750 + * at once this should be updated to take advantage of the fact.
3752 + * N.B. For Linux the reclen in a dirent is the number of characters
3753 + * in the filename, for SCO (at least) reclen is the total size of
3754 + * the particular dirent rounded up to the next multiple of 4. The SCO
3755 + * behaviour is faithfully emulated here.
3758 + * We don't truncate long filenames at all when copying. If we meet a
3759 + * long filename and the buffer supplied by the application simply isn't
3760 + * big enough to hold it we'll return without filling the buffer (i.e
3761 + * return 0). The application will see this as a (premature) end of
3762 + * directory. Is there a work around for this at all???
3765 +sol_getdents64(int fd, char *buf, int nbytes)
3767 + int error, here, posn, reclen;
3768 + struct file *file;
3769 + struct old_linux_dirent *d;
3770 + mm_segment_t old_fs;
3772 + error = verify_area(VERIFY_WRITE, buf, nbytes);
3776 + /* Check the file handle here. This is so we can access the current
3777 + * position in the file structure safely without a tedious call
3778 + * to sys_lseek that does nothing useful.
3784 + d = (struct old_linux_dirent *)__get_free_page(GFP_KERNEL);
3790 + error = posn = reclen = 0;
3791 + while (posn + reclen < nbytes) {
3793 + struct sol_dirent64 tmpbuf;
3794 + /* Save the current position and get another dirent */
3795 + here = file->f_pos;
3796 + old_fs = get_fs();
3797 + set_fs (get_ds());
3798 + error = old_readdir(fd, d, 1);
3803 + /* If it'll fit in the buffer save it.
3804 + * Otherwise back up so it is read next time around.
3805 + * Oh, if we're at the beginning of the buffer there's
3806 + * no chance that this entry will ever fit so don't
3807 + * copy it and don't back off - we'll just pretend it
3810 + string_size = d->d_namlen + 1; /* chars in d_name + trailing zero */
3811 + reclen = (sizeof(long long) /* d_ino */
3812 + + sizeof(long long) /* d_offset */
3813 + + sizeof(unsigned short) /* d_namlen */
3815 + + 3) & (~3); /* align to a 4 byte boundary */
3816 + if (posn + reclen <= nbytes) {
3817 + tmpbuf.d_off = file->f_pos;
3818 + tmpbuf.d_ino = d->d_ino;
3819 + tmpbuf.d_off = file->f_pos;
3820 + tmpbuf.d_reclen = reclen;
3821 + copy_to_user(buf+posn, &tmpbuf,
3822 + sizeof(struct sol_dirent64) -1);
3823 + copy_to_user(buf+posn+sizeof(struct sol_dirent64)-2,
3824 + &d->d_name, string_size);
3826 + } else if (posn) {
3827 + sys_lseek(fd, here, 0);
3828 + } /* else posn == 0 */
3831 + /* Loose the intermediate buffer. */
3832 + free_page((unsigned long)d);
3836 + /* If we've put something in the buffer return the byte count
3837 + * otherwise return the error status.
3839 + return ((posn > 0) ? posn : error);
3844 +sol_mmap64(u_int addr, u_int len, int prot, int flags,
3845 + int fd, u_int off_hi, u_int off)
3847 + loff_t off64 = (off | ((loff_t)off_hi << 32));
3848 + u_long pgoff = (off64 >> PAGE_SHIFT);
3849 + struct file *file = NULL;
3852 + if ((off64 + PAGE_ALIGN(len)) < off64)
3855 + if (!(off64 & ~PAGE_MASK))
3858 + flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
3859 + if (!(flags & MAP_ANONYMOUS)) {
3860 + if (!(file = fget(fd)))
3864 + if (!(flags & 0x80000000) && addr)
3865 + flags |= MAP_FIXED;
3867 + flags &= 0x7fffffff;
3869 + down_write(¤t->mm->mmap_sem);
3870 + error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
3871 + up_write(¤t->mm->mmap_sem);
3877 diff -Nru linux-2.6.7/abi/solaris/Makefile linux-2.6.7-abi/abi/solaris/Makefile
3878 --- linux-2.6.7/abi/solaris/Makefile 1970-01-01 01:00:00.000000000 +0100
3879 +++ linux-2.6.7-abi/abi/solaris/Makefile 2004-07-22 17:44:20.000000000 +0200
3882 +abi-solaris-objs:= lfs.o solarisx86.o socket.o stat.o sysent.o
3884 +obj-$(CONFIG_ABI_SOLARIS) += abi-solaris.o
3886 +abi-solaris.o: $(abi-solaris-objs)
3887 + $(LD) -r -o $@ $(abi-solaris-objs)
3888 diff -Nru linux-2.6.7/abi/solaris/socket.c linux-2.6.7-abi/abi/solaris/socket.c
3889 --- linux-2.6.7/abi/solaris/socket.c 1970-01-01 01:00:00.000000000 +0100
3890 +++ linux-2.6.7-abi/abi/solaris/socket.c 2004-07-22 17:44:20.000000000 +0200
3893 + * socket.c: Socket syscall emulation for Solaris 2.6+
3895 + * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz)
3897 + * 1999-08-19 Fixed socketpair code
3898 + * Jason Rappleye (rappleye@ccr.buffalo.edu)
3903 +#include <linux/types.h>
3904 +#include <linux/sched.h>
3905 +#include <linux/smp_lock.h>
3906 +#include <linux/mm.h>
3907 +#include <linux/slab.h>
3908 +#include <linux/net.h>
3909 +#include <linux/socket.h>
3910 +#include <linux/file.h>
3911 +#include <linux/syscalls.h>
3913 +#include <asm/uaccess.h>
3914 +#include <asm/string.h>
3916 +#define SOCK_SOL_STREAM 2
3917 +#define SOCK_SOL_DGRAM 1
3918 +#define SOCK_SOL_RAW 4
3919 +#define SOCK_SOL_RDM 5
3920 +#define SOCK_SOL_SEQPACKET 6
3922 +#define SOL_SO_SNDLOWAT 0x1003
3923 +#define SOL_SO_RCVLOWAT 0x1004
3924 +#define SOL_SO_SNDTIMEO 0x1005
3925 +#define SOL_SO_RCVTIMEO 0x1006
3926 +#define SOL_SO_STATE 0x2000
3928 +#define SOL_SS_NDELAY 0x040
3929 +#define SOL_SS_NONBLOCK 0x080
3930 +#define SOL_SS_ASYNC 0x100
3932 +#define SO_STATE 0x000e
3936 + * 64 bit vs 32bit issues.
3938 +#if BITS_PER_LONG == 32
3939 +# define sys32_getsockopt sys_getsockopt
3940 +# define A(ptr) ((void *)(ptr))
3941 +# define __kernel_size_t32 __kernel_size_t
3945 +int sunos_setsockopt(int fd, int level, int optname, u32 optval,
3948 + int tr_opt = optname;
3951 + if (level == SOL_IP) {
3952 + /* Multicast socketopts (ttl, membership) */
3953 + if (tr_opt >=2 && tr_opt <= 6)
3956 + ret = sys_setsockopt(fd, level, tr_opt, (char *)A(optval), optlen);
3960 +int sunos_getsockopt(int fd, int level, int optname,
3961 + u32 optval, u32 optlen)
3963 + int tr_opt = optname;
3966 + if (level == SOL_IP) {
3967 + /* Multicast socketopts (ttl, membership) */
3968 + if (tr_opt >=2 && tr_opt <= 6)
3971 + ret = sys32_getsockopt(fd, level, tr_opt, (char *)optval, (int *)optlen);
3975 +static int socket_check(int family, int type)
3977 + if (family != PF_UNIX && family != PF_INET)
3978 + return -ESOCKTNOSUPPORT;
3980 + case SOCK_SOL_STREAM:
3981 + type = SOCK_STREAM;
3983 + case SOCK_SOL_DGRAM:
3984 + type = SOCK_DGRAM;
3986 + case SOCK_SOL_RAW:
3989 + case SOCK_SOL_RDM:
3992 + case SOCK_SOL_SEQPACKET:
3993 + type = SOCK_SEQPACKET;
4001 +static int solaris_to_linux_sockopt(int optname)
4003 + switch (optname) {
4004 + case SOL_SO_SNDLOWAT:
4005 + optname = SO_SNDLOWAT;
4007 + case SOL_SO_RCVLOWAT:
4008 + optname = SO_RCVLOWAT;
4010 + case SOL_SO_SNDTIMEO:
4011 + optname = SO_SNDTIMEO;
4013 + case SOL_SO_RCVTIMEO:
4014 + optname = SO_RCVTIMEO;
4016 + case SOL_SO_STATE:
4017 + optname = SO_STATE;
4024 +int solaris_socket(int family, int type, int protocol)
4026 + type = socket_check (family, type);
4029 + return sys_socket(family, type, protocol);
4032 +int solaris_socketpair(int *usockvec)
4034 + /* solaris socketpair really only takes one arg at the syscall
4035 + * level, int * usockvec. The libs apparently take care of
4036 + * making sure that family==AF_UNIX and type==SOCK_STREAM. The
4037 + * pointer we really want ends up residing in the first (and
4038 + * supposedly only) argument.
4041 + return sys_socketpair(AF_UNIX, SOCK_STREAM, 0, (int *)usockvec);
4044 +int solaris_bind(int fd, struct sockaddr *addr, int addrlen)
4046 + return sys_bind(fd, addr, addrlen);
4049 +int solaris_setsockopt(int fd, int level, int optname, u32 optval, int optlen)
4051 + optname = solaris_to_linux_sockopt(optname);
4054 + if (optname == SO_STATE)
4057 + return sunos_setsockopt(fd, level, optname, optval, optlen);
4060 +int solaris_getsockopt(int fd, int level, int optname, u32 optval, u32 optlen)
4062 + optname = solaris_to_linux_sockopt(optname);
4066 + if (optname == SO_STATE)
4067 + optname = SOL_SO_STATE;
4069 + return sunos_getsockopt(fd, level, optname, optval, optlen);
4072 +int solaris_connect(int fd, struct sockaddr *addr, int addrlen)
4074 + return sys_connect(fd, addr, addrlen);
4077 +int solaris_accept(int fd, struct sockaddr *addr, int *addrlen)
4079 + return sys_accept(fd, addr, addrlen);
4082 +int solaris_listen(int fd, int backlog)
4084 + return sys_listen(fd, backlog);
4087 +int solaris_shutdown(int fd, int how)
4089 + return sys_shutdown(fd, how);
4092 +#define MSG_SOL_OOB 0x1
4093 +#define MSG_SOL_PEEK 0x2
4094 +#define MSG_SOL_DONTROUTE 0x4
4095 +#define MSG_SOL_EOR 0x8
4096 +#define MSG_SOL_CTRUNC 0x10
4097 +#define MSG_SOL_TRUNC 0x20
4098 +#define MSG_SOL_WAITALL 0x40
4099 +#define MSG_SOL_DONTWAIT 0x80
4101 +static int solaris_to_linux_msgflags(int flags)
4103 + int fl = flags & (MSG_OOB|MSG_PEEK|MSG_DONTROUTE);
4105 + if (flags & MSG_SOL_EOR) fl |= MSG_EOR;
4106 + if (flags & MSG_SOL_CTRUNC) fl |= MSG_CTRUNC;
4107 + if (flags & MSG_SOL_TRUNC) fl |= MSG_TRUNC;
4108 + if (flags & MSG_SOL_WAITALL) fl |= MSG_WAITALL;
4109 + if (flags & MSG_SOL_DONTWAIT) fl |= MSG_DONTWAIT;
4113 +static int linux_to_solaris_msgflags(int flags)
4115 + int fl = flags & (MSG_OOB|MSG_PEEK|MSG_DONTROUTE);
4117 + if (flags & MSG_EOR) fl |= MSG_SOL_EOR;
4118 + if (flags & MSG_CTRUNC) fl |= MSG_SOL_CTRUNC;
4119 + if (flags & MSG_TRUNC) fl |= MSG_SOL_TRUNC;
4120 + if (flags & MSG_WAITALL) fl |= MSG_SOL_WAITALL;
4121 + if (flags & MSG_DONTWAIT) fl |= MSG_SOL_DONTWAIT;
4125 +int solaris_recvfrom(int s, char *buf, int len, int flags, u32 from, u32 fromlen)
4127 + return sys_recvfrom(s, buf, len, solaris_to_linux_msgflags(flags), (struct sockaddr *)A(from), (int *)A(fromlen));
4130 +int solaris_recv(int s, char *buf, int len, int flags)
4132 + return sys_recvfrom(s, buf, len, solaris_to_linux_msgflags(flags), NULL, NULL);
4135 +int solaris_sendto(int s, char *buf, int len, int flags, u32 to, u32 tolen)
4137 + return sys_sendto(s, buf, len, solaris_to_linux_msgflags(flags), (struct sockaddr *)A(to), (int)A(tolen));
4140 +int solaris_send(int s, char *buf, int len, int flags)
4142 + return sys_sendto(s, buf, len, solaris_to_linux_msgflags(flags), NULL, 0);
4145 +int solaris_getpeername(int fd, struct sockaddr *addr, int *addrlen)
4147 + return sys_getpeername(fd, addr, addrlen);
4150 +int solaris_getsockname(int fd, struct sockaddr *addr, int *addrlen)
4152 + return sys_getsockname(fd, addr, addrlen);
4155 +/* XXX This really belongs in some header file... -DaveM */
4156 +#define MAX_SOCK_ADDR 128 /* 108 for Unix domain -
4157 + 16 for IP, 16 for IPX,
4159 + about 80 for AX.25 */
4161 +struct sol_nmsghdr {
4167 + u32 msg_controllen;
4171 +struct sol_cmsghdr {
4175 + unsigned char cmsg_data[0];
4183 +static inline int iov_from_user32_to_kern(struct iovec *kiov,
4184 + struct iovec32 *uiov32,
4192 + if(get_user(len, &uiov32->iov_len) ||
4193 + get_user(buf, &uiov32->iov_base)) {
4194 + tot_len = -EFAULT;
4198 + kiov->iov_base = (void *)A(buf);
4199 + kiov->iov_len = (__kernel_size_t) len;
4207 +static inline int msghdr_from_user32_to_kern(struct msghdr *kmsg,
4208 + struct sol_nmsghdr *umsg)
4210 + u32 tmp1, tmp2, tmp3;
4213 + err = get_user(tmp1, &umsg->msg_name);
4214 + err |= __get_user(tmp2, &umsg->msg_iov);
4215 + err |= __get_user(tmp3, &umsg->msg_control);
4219 + kmsg->msg_name = (void *)A(tmp1);
4220 + kmsg->msg_iov = (struct iovec *)A(tmp2);
4221 + kmsg->msg_control = (void *)A(tmp3);
4223 + err = get_user(kmsg->msg_namelen, &umsg->msg_namelen);
4224 + err |= get_user(kmsg->msg_controllen, &umsg->msg_controllen);
4225 + err |= get_user(kmsg->msg_flags, &umsg->msg_flags);
4227 + kmsg->msg_flags = solaris_to_linux_msgflags(kmsg->msg_flags);
4232 +/* I've named the args so it is easy to tell whose space the pointers are in. */
4233 +static int verify_iovec32(struct msghdr *kern_msg, struct iovec *kern_iov,
4234 + char *kern_address, int mode)
4238 + if(kern_msg->msg_namelen) {
4239 + if(mode==VERIFY_READ) {
4240 + int err = move_addr_to_kernel(kern_msg->msg_name,
4241 + kern_msg->msg_namelen,
4246 + kern_msg->msg_name = kern_address;
4248 + kern_msg->msg_name = NULL;
4250 + if(kern_msg->msg_iovlen > UIO_FASTIOV) {
4251 + kern_iov = kmalloc(kern_msg->msg_iovlen * sizeof(struct iovec),
4257 + tot_len = iov_from_user32_to_kern(kern_iov,
4258 + (struct iovec32 *)kern_msg->msg_iov,
4259 + kern_msg->msg_iovlen);
4261 + kern_msg->msg_iov = kern_iov;
4262 + else if(kern_msg->msg_iovlen > UIO_FASTIOV)
4268 +int solaris_sendmsg(int fd, struct sol_nmsghdr *user_msg, unsigned user_flags)
4270 + struct socket *sock;
4271 + char address[MAX_SOCK_ADDR];
4272 + struct iovec iov[UIO_FASTIOV];
4273 + unsigned char ctl[sizeof(struct cmsghdr) + 20];
4274 + unsigned char *ctl_buf = ctl;
4275 + struct msghdr kern_msg;
4276 + int err, total_len;
4278 + if(msghdr_from_user32_to_kern(&kern_msg, user_msg))
4280 + if(kern_msg.msg_iovlen > UIO_MAXIOV)
4282 + err = verify_iovec32(&kern_msg, iov, address, VERIFY_READ);
4287 + if(kern_msg.msg_controllen) {
4288 + struct sol_cmsghdr *ucmsg = (struct sol_cmsghdr *)kern_msg.msg_control;
4289 + unsigned long *kcmsg;
4290 + __kernel_size_t32 cmlen;
4292 + if(kern_msg.msg_controllen > sizeof(ctl) &&
4293 + kern_msg.msg_controllen <= 256) {
4295 + ctl_buf = kmalloc(kern_msg.msg_controllen, GFP_KERNEL);
4299 + __get_user(cmlen, &ucmsg->cmsg_len);
4300 + kcmsg = (unsigned long *) ctl_buf;
4301 + *kcmsg++ = (unsigned long)cmlen;
4303 + if(copy_from_user(kcmsg, &ucmsg->cmsg_level,
4304 + kern_msg.msg_controllen - sizeof(__kernel_size_t32)))
4306 + kern_msg.msg_control = ctl_buf;
4308 + kern_msg.msg_flags = solaris_to_linux_msgflags(user_flags);
4311 + sock = sockfd_lookup(fd, &err);
4312 + if (sock != NULL) {
4313 + if (sock->file->f_flags & O_NONBLOCK)
4314 + kern_msg.msg_flags |= MSG_DONTWAIT;
4315 + err = sock_sendmsg(sock, &kern_msg, total_len);
4321 + /* N.B. Use kfree here, as kern_msg.msg_controllen might change? */
4322 + if(ctl_buf != ctl)
4325 + if(kern_msg.msg_iov != iov)
4326 + kfree(kern_msg.msg_iov);
4331 +int solaris_recvmsg(int fd, struct sol_nmsghdr *user_msg, unsigned user_flags)
4333 + struct iovec iovstack[UIO_FASTIOV];
4334 + struct msghdr kern_msg;
4335 + char addr[MAX_SOCK_ADDR];
4336 + struct socket *sock;
4337 + struct iovec *iov = iovstack;
4338 + struct sockaddr *uaddr;
4340 + unsigned long cmsg_ptr;
4341 + int err, total_len, len = 0;
4343 + if(msghdr_from_user32_to_kern(&kern_msg, user_msg))
4345 + if(kern_msg.msg_iovlen > UIO_MAXIOV)
4348 + uaddr = kern_msg.msg_name;
4349 + uaddr_len = &user_msg->msg_namelen;
4350 + err = verify_iovec32(&kern_msg, iov, addr, VERIFY_WRITE);
4355 + cmsg_ptr = (unsigned long) kern_msg.msg_control;
4356 + kern_msg.msg_flags = 0;
4359 + sock = sockfd_lookup(fd, &err);
4360 + if (sock != NULL) {
4361 + if (sock->file->f_flags & O_NONBLOCK)
4362 + user_flags |= MSG_DONTWAIT;
4363 + err = sock_recvmsg(sock, &kern_msg, total_len, user_flags);
4370 + if(uaddr != NULL && err >= 0)
4371 + err = move_addr_to_user(addr, kern_msg.msg_namelen, uaddr, uaddr_len);
4373 + err = __put_user(linux_to_solaris_msgflags(kern_msg.msg_flags), &user_msg->msg_flags);
4375 + /* XXX Convert cmsg back into userspace 32-bit format... */
4376 + err = __put_user((unsigned long)kern_msg.msg_control - cmsg_ptr,
4377 + &user_msg->msg_controllen);
4381 + if(kern_msg.msg_iov != iov)
4382 + kfree(kern_msg.msg_iov);
4388 diff -Nru linux-2.6.7/abi/solaris/solarisx86.c linux-2.6.7-abi/abi/solaris/solarisx86.c
4389 --- linux-2.6.7/abi/solaris/solarisx86.c 1970-01-01 01:00:00.000000000 +0100
4390 +++ linux-2.6.7-abi/abi/solaris/solarisx86.c 2004-07-22 17:44:20.000000000 +0200
4393 +#include <linux/types.h>
4394 +#include <linux/kernel.h>
4395 +#include <linux/sched.h>
4396 +#include <linux/socket.h>
4397 +#include <linux/file.h>
4398 +#include <linux/mm.h>
4399 +#include <linux/syscalls.h>
4400 +#include <asm/uaccess.h>
4402 +#include <abi/svr4/sigset.h>
4405 +int sol_llseek(struct pt_regs * regs)
4408 + unsigned long offset_high, offset_low;
4411 + unsigned int rvalue;
4412 + mm_segment_t old_fs;
4413 + struct inode *inode;
4414 + struct file *file;
4415 + get_user(fd, ((unsigned int *)regs->esp)+1);
4416 + get_user(offset_low, ((unsigned long *)regs->esp)+2);
4417 + get_user(offset_high, ((unsigned long *)regs->esp)+3);
4418 + get_user(origin, ((unsigned int *)regs->esp)+4);
4420 + old_fs = get_fs();
4422 + rvalue = sys_llseek(fd,offset_high,offset_low,&res,origin);
4425 + if ( rvalue < -ENOIOCTLCMD) {
4426 + regs->edx = (res >> 32);
4427 + rvalue = (res & 0xffffffff);
4429 + else if (rvalue == -ESPIPE) {
4430 + /* Solaris allows you to seek on a pipe */
4433 + inode = file->f_dentry->d_inode;
4434 + if (inode && (S_ISCHR(inode->i_mode)
4435 + || S_ISBLK(inode->i_mode))) {
4446 +int sol_memcntl(unsigned addr, unsigned len, int cmd, unsigned arg,
4447 + int attr, int mask)
4449 + // printk("ibcs_memcntl being ignored\n");
4460 +int sol_acl(char *pathp, int cmd, int nentries, void *aclbufp)
4476 diff -Nru linux-2.6.7/abi/solaris/stat.c linux-2.6.7-abi/abi/solaris/stat.c
4477 --- linux-2.6.7/abi/solaris/stat.c 1970-01-01 01:00:00.000000000 +0100
4478 +++ linux-2.6.7-abi/abi/solaris/stat.c 2004-07-22 17:44:20.000000000 +0200
4481 + * Copyright (c) 2001 Christoph Hellwig.
4482 + * All rights reserved.
4484 + * This program is free software; you can redistribute it and/or modify
4485 + * it under the terms of the GNU General Public License as published by
4486 + * the Free Software Foundation; either version 2 of the License, or
4487 + * (at your option) any later version.
4489 + * This program is distributed in the hope that it will be useful,
4490 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
4491 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4492 + * GNU General Public License for more details.
4494 + * You should have received a copy of the GNU General Public License
4495 + * aint32_t with this program; if not, write to the Free Software
4496 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
4502 + * Solaris 2 stat64 & friends support.
4504 +#include <linux/kernel.h>
4505 +#include <linux/fs.h>
4506 +#include <linux/sched.h>
4507 +#include <linux/file.h>
4508 +#include <linux/string.h>
4509 +#include <asm/uaccess.h>
4511 +#include <abi/solaris/types.h>
4512 +#include <abi/solaris/stat.h>
4514 +#include <abi/util/trace.h>
4515 +#include <abi/util/stat.h>
4519 +report_sol_stat64(struct kstat *stp, struct sol_stat64 *bufp)
4521 + struct sol_stat64 buf;
4523 + memset(&buf, 0, sizeof(struct sol_stat64));
4526 + buf.st_dev = linux_to_sol_dev_t(stp->dev);
4527 + buf.st_ino = linux_to_sol_ino_t(stp->ino);
4528 + buf.st_mode = stp->mode;
4529 + buf.st_nlink = stp->nlink;
4530 + buf.st_uid = linux_to_sol_uid_t(stp->uid);
4531 + buf.st_gid = linux_to_sol_gid_t(stp->gid);
4532 + buf.st_rdev = linux_to_sol_dev_t(stp->rdev);
4533 + buf.st_size = stp->size;
4535 + buf.st_atime = stp->atime.tv_sec;
4536 + buf.st_mtime = stp->mtime.tv_sec;
4537 + buf.st_ctime = stp->ctime.tv_sec;
4539 + buf.st_blksize = stp->blksize;
4540 + buf.st_blocks = stp->blocks;
4542 + strcpy(buf.st_fstype, "ext2");
4544 + if (copy_to_user(bufp, &buf, sizeof(struct sol_stat64)))
4550 +sol_stat64(char *filename, struct sol_stat64 *bufp)
4555 + error = vfs_stat(filename, &st);
4557 + error = report_sol_stat64(&st, bufp);
4562 +sol_lstat64(char *filename, struct sol_stat64 *bufp)
4567 + error = vfs_lstat(filename, &st);
4569 + error = report_sol_stat64(&st, bufp);
4574 +sol_fstat64(int fd, struct sol_stat64 *bufp)
4579 + error = vfs_fstat(fd, &st);
4581 + error = report_sol_stat64(&st, bufp);
4584 diff -Nru linux-2.6.7/abi/solaris/sysent.c linux-2.6.7-abi/abi/solaris/sysent.c
4585 --- linux-2.6.7/abi/solaris/sysent.c 1970-01-01 01:00:00.000000000 +0100
4586 +++ linux-2.6.7-abi/abi/solaris/sysent.c 2004-07-22 17:44:20.000000000 +0200
4589 + * Copyright (c) 2001 Christoph Hellwig.
4590 + * All rights reserved.
4592 + * This program is free software; you can redistribute it and/or modify
4593 + * it under the terms of the GNU General Public License as published by
4594 + * the Free Software Foundation; either version 2 of the License, or
4595 + * (at your option) any later version.
4597 + * This program is distributed in the hope that it will be useful,
4598 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
4599 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4600 + * GNU General Public License for more details.
4602 + * You should have received a copy of the GNU General Public License
4603 + * along with this program; if not, write to the Free Software
4604 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
4610 + * Solaris sysent and error tables.
4612 +#include <linux/config.h>
4613 +#include <linux/kernel.h>
4614 +#include <linux/module.h>
4615 +#include <linux/init.h>
4616 +#include <linux/personality.h>
4617 +#include <linux/syscalls.h>
4618 +#include <linux/socket.h>
4619 +#include <linux/net.h>
4620 +#include <asm/uaccess.h>
4622 +#include <abi/signal.h>
4624 +#include <abi/svr4/sysent.h>
4625 +#include <abi/solaris/sysent.h>
4626 +#include <abi/util/socket.h>
4628 +#include <abi/util/errno.h>
4629 +#include <abi/util/sysent.h>
4631 +/* kernel module specifications */
4632 +#ifndef EXPORT_NO_SYMBOLS
4633 +#define EXPORT_NO_SYMBOLS
4636 +MODULE_DESCRIPTION("Solaris personality");
4637 +MODULE_AUTHOR("Christoph Hellwig, partially taken from iBCS");
4638 +MODULE_LICENSE("GPL");
4643 +/* XXX kill this one */
4644 +#define ITR(trace, name, args) ,name,args
4648 + * We could remove some of the long identity mapped runs but at the
4649 + * expense of extra comparisons for each mapping at run time...
4651 +static u_char solaris_err_table[] = {
4652 +/* 0 - 9 */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
4653 +/* 10 - 19 */ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
4654 +/* 20 - 29 */ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
4655 +/* 30 - 39 */ 30, 31, 32, 33, 34, 45, 78, 46, 89, 93,
4656 +/* 40 - 49 */ 90, 90, 35, 36, 37, 38, 39, 40, 41, 42,
4657 +/* 50 - 59 */ 43, 44, 50, 51, 52, 53, 54, 55, 56, 57,
4658 +/* 60 - 69 */ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
4659 +/* 70 - 79 */ 70, 71, 74, 76, 77, 79, 80, 81, 82, 83,
4660 +/* 80 - 89 */ 84, 85, 86, 87, 88, 91, 92, 94, 95, 96,
4661 +/* 90 - 99 */ 97, 98, 99, 120, 121, 122, 123, 124, 125, 126,
4662 +/* 100 - 109 */ 127, 128, 129, 130, 131, 132, 133, 134, 143, 144,
4663 +/* 110 - 119 */ 145, 146, 147, 148, 149, 150, 22, 135, 137, 138,
4664 +/* 120 - 122 */ 139, 140, 28
4668 + * Map Linux RESTART* values (512,513,514) to EINTR
4670 +static u_char lnx_err_table[] = {
4671 +/* 512 - 514 */ EINTR, EINTR, EINTR
4674 +struct map_segment solaris_err_map[] = {
4675 + { 0, 0+sizeof(solaris_err_table)-1, solaris_err_table },
4676 + { 512, 512+sizeof(lnx_err_table)-1, lnx_err_table },
4680 +static long linux_to_solaris_signals[NSIGNALS+1] = {
4681 +/* 0 - 3 */ 0, IBCS_SIGHUP, IBCS_SIGINT, IBCS_SIGQUIT,
4682 +/* 4 - 7 */ IBCS_SIGILL, IBCS_SIGTRAP, IBCS_SIGABRT, -1,
4683 +/* 8 - 11 */ IBCS_SIGFPE, IBCS_SIGKILL, IBCS_SIGUSR1, IBCS_SIGSEGV,
4684 +/* 12 - 15 */ IBCS_SIGUSR2, IBCS_SIGPIPE, IBCS_SIGALRM, IBCS_SIGTERM,
4685 +/* 16 - 19 */ IBCS_SIGSEGV, IBCS_SIGCHLD, IBCS_SIGCONT, IBCS_SIGSTOP,
4686 +/* 20 - 23 */ IBCS_SIGTSTP, IBCS_SIGTTIN, IBCS_SIGTTOU, IBCS_SIGURG,
4687 +/* 24 - 27 */ IBCS_SIGGXCPU, IBCS_SIGGXFSZ, IBCS_SIGVTALRM, IBCS_SIGPROF,
4688 +/* 28 - 31 */ IBCS_SIGWINCH, IBCS_SIGIO, IBCS_SIGPWR, -1,
4692 +static long solaris_to_linux_signals[NSIGNALS+1] = {
4693 +/* 0 - 3 */ 0, SIGHUP, SIGINT, SIGQUIT,
4694 +/* 4 - 7 */ SIGILL, SIGTRAP, SIGIOT, SIGUNUSED,
4695 +/* 8 - 11 */ SIGFPE, SIGKILL, SIGUNUSED, SIGSEGV,
4696 +/* 12 - 15 */ SIGUNUSED, SIGPIPE, SIGALRM, SIGTERM,
4697 +/* 16 - 19 */ SIGUSR1, SIGUSR2, SIGCHLD, SIGPWR,
4698 +/* 20 - 23 */ SIGWINCH, SIGURG, SIGPOLL, SIGSTOP,
4699 +/* 24 - 27 */ SIGTSTP, SIGCONT, SIGTTIN, SIGTTOU,
4700 +/* 28 - 31 */ SIGVTALRM, SIGPROF, SIGXCPU, SIGXFSZ,
4704 +static char solaris_socktype[] = {
4713 +static struct map_segment solaris_socktype_map[] = {
4714 + { 1, 6, solaris_socktype },
4718 +static struct map_segment solaris_sockopt_map[] = {
4719 + { 0x0001, 0x0001, (char *)SO_DEBUG },
4720 + { 0x0002, 0x0002, (char *)__SO_ACCEPTCON },
4721 + { 0x0004, 0x0004, (char *)SO_REUSEADDR },
4722 + { 0x0008, 0x0008, (char *)SO_KEEPALIVE },
4723 + { 0x0010, 0x0010, (char *)SO_DONTROUTE },
4724 + { 0x0020, 0x0020, (char *)SO_BROADCAST },
4725 + { 0x0040, 0x0040, (char *)SO_USELOOPBACK },
4726 + { 0x0080, 0x0080, (char *)SO_LINGER },
4727 + { 0x0100, 0x0100, (char *)SO_OOBINLINE },
4728 + { 0x0200, 0x0200, (char *)SO_ORDREL },
4729 + { 0x0400, 0x0400, (char *)SO_IMASOCKET },
4730 + { 0x1001, 0x1001, (char *)SO_SNDBUF },
4731 + { 0x1002, 0x1002, (char *)SO_RCVBUF },
4732 + { 0x1003, 0x1003, (char *)SO_SNDLOWAT },
4733 + { 0x1004, 0x1004, (char *)SO_RCVLOWAT },
4734 + { 0x1005, 0x1005, (char *)SO_SNDTIMEO },
4735 + { 0x1006, 0x1006, (char *)SO_RCVTIMEO },
4736 + { 0x1007, 0x1007, (char *)SO_ERROR },
4737 + { 0x1008, 0x1008, (char *)SO_TYPE },
4738 + { 0x1009, 0x1009, (char *)SO_PROTOTYPE },
4742 +static struct map_segment solaris_af_map[] = {
4748 +static struct sysent solaris_syscall_table[] = {
4749 + { abi_syscall, Fast ITR(0, "syscall", "") }, /* 0 */
4750 + { sys_exit, 1 ITR(0, "exit", "d") }, /* 1 */
4751 + { abi_fork, Spl ITR(0, "fork", "") }, /* 2 */
4752 + { abi_read, 3 ITR(0, "read", "dpd") }, /* 3 */
4753 + { sys_write, 3 ITR(0, "write", "dpd") }, /* 4 */
4754 + { svr4_open, 3 ITR(0, "open", "soo") }, /* 5 */
4755 + { sys_close, 1 ITR(0, "close", "d") }, /* 6 */
4756 + { abi_wait, Spl ITR(0, "wait", "xxx") }, /* 7 */
4757 + { sys_creat, 2 ITR(0, "creat", "so") }, /* 8 */
4758 + { sys_link, 2 ITR(0, "link", "ss") }, /* 9 */
4759 + { sys_unlink, 1 ITR(0, "unlink", "s") }, /* 10 */
4760 + { abi_exec, Spl ITR(0, "exec", "sxx") }, /* 11 */
4761 + { sys_chdir, 1 ITR(0, "chdir", "s") }, /* 12 */
4762 + { abi_time, 0 ITR(0, "time", "") }, /* 13 */
4763 + { svr4_mknod, 3 ITR(0, "mknod", "soo") }, /* 14 */
4764 + { sys_chmod, 2 ITR(0, "chmod", "so") }, /* 15 */
4765 + { sys_chown, 3 ITR(0, "chown", "sdd") }, /* 16 */
4766 + { abi_brk, 1 ITR(0, "brk/break", "x") }, /* 17 */
4767 + { svr4_stat, 2 ITR(0, "stat", "sp") }, /* 18 */
4768 + { sys_lseek, 3 ITR(0, "seek/lseek", "ddd") }, /* 19 */
4769 + { abi_getpid, Spl ITR(0, "getpid", "") }, /* 20 */
4770 + { 0, Ukn ITR(1, "mount", "") }, /* 21 */
4771 + { sys_umount, 1 ITR(0, "umount", "s") }, /* 22 */
4772 + { sys_setuid, 1 ITR(0, "setuid", "d") }, /* 23 */
4773 + { abi_getuid, Spl ITR(0, "getuid", "") }, /* 24 */
4774 + { sys_stime, 1 ITR(0, "stime", "d") }, /* 25 */
4775 + { 0, Ukn ITR(0, "ptrace", "") }, /* 26 */
4776 + { sys_alarm, 1 ITR(0, "alarm", "d") }, /* 27 */
4777 + { svr4_fstat, 2 ITR(0, "fstat", "dp") }, /* 28 */
4778 + { sys_pause, 0 ITR(0, "pause", "") }, /* 29 */
4779 + { sys_utime, 2 ITR(0, "utime", "xx") }, /* 30 */
4780 + { 0, Ukn ITR(0, "stty", "") }, /* 31 */
4781 + { 0, Ukn ITR(1, "gtty", "") }, /* 32 */
4782 + { sys_access, 2 ITR(0, "access", "so") }, /* 33 */
4783 + { sys_nice, 1 ITR(0, "nice", "d") }, /* 34 */
4784 + { svr4_statfs, 4 ITR(0, "statfs", "spdd") }, /* 35 */
4785 + { sys_sync, 0 ITR(0, "sync", "") }, /* 36 */
4786 + { abi_kill, 2 ITR(0, "kill", "dd") }, /* 37 */
4787 + { svr4_fstatfs, 4 ITR(0, "fstatfs", "dpdd") }, /* 38 */
4788 + { abi_procids, Spl ITR(0, "procids", "d") }, /* 39 */
4789 + { 0, Ukn ITR(0, "cxenix", "") }, /* 40 */
4790 + { sys_dup, 1 ITR(0, "dup", "d") }, /* 41 */
4791 + { abi_pipe, Spl ITR(0, "pipe", "") }, /* 42 */
4792 + { sys_times, 1 ITR(0, "times", "p") }, /* 43 */
4793 + { 0, 0 ITR(0, "prof", "") }, /* 44 */
4794 + { 0, Ukn ITR(1, "lock/plock", "") }, /* 45 */
4795 + { sys_setgid, 1 ITR(0, "setgid", "d") }, /* 46 */
4796 + { abi_getgid, Spl ITR(0, "getgid", "") }, /* 47 */
4797 + { abi_sigfunc, Fast ITR(0, "sigfunc", "xxx") }, /* 48 */
4798 + { svr4_msgsys, Spl ITR(0, "msgsys", "dxddd")}, /* 49 */
4799 + { svr4_sysi86, 3 ITR(0, "sysi86/sys3b", "d") }, /* 50 */
4800 + { sys_acct, 1 ITR(0, "acct/sysacct", "x") }, /* 51 */
4801 + { svr4_shmsys, Fast ITR(0, "shmsys", "ddxo")}, /* 52 */
4802 + { svr4_semsys, Spl ITR(0, "semsys", "dddx")}, /* 53 */
4803 + { svr4_ioctl, Spl ITR(0, "ioctl", "dxx") }, /* 54 */
4804 + { 0, 3 ITR(0, "uadmin", "xxx") }, /* 55 */
4805 + { 0, Ukn ITR(1, "?", "") }, /* 56 */
4806 + { v7_utsname, 1 ITR(0, "utsys", "x") }, /* 57 */
4807 + { sys_fsync, 1 ITR(0, "fsync", "d") }, /* 58 */
4808 + { abi_exec, Spl ITR(0, "execv", "spp") }, /* 59 */
4809 + { sys_umask, 1 ITR(0, "umask", "o") }, /* 60 */
4810 + { sys_chroot, 1 ITR(0, "chroot", "s") }, /* 61 */
4811 + { svr4_fcntl, 3 ITR(0, "fcntl", "dxx") }, /* 62 */
4812 + { svr4_ulimit, 2 ITR(0, "ulimit", "xx") }, /* 63 */
4813 + { 0, Ukn ITR(1, "?", "") }, /* 64 */
4814 + { 0, Ukn ITR(1, "?", "") }, /* 65 */
4815 + { 0, Ukn ITR(1, "?", "") }, /* 66 */
4816 + { 0, Ukn ITR(1, "?", "") }, /* 67 */
4817 + { 0, Ukn ITR(1, "?", "") }, /* 68 */
4818 + { 0, Ukn ITR(1, "?", "") }, /* 69 */
4819 + { 0, Ukn ITR(1, "advfs", "") }, /* 70 */
4820 + { 0, Ukn ITR(1, "unadvfs", "") }, /* 71 */
4821 + { 0, Ukn ITR(1, "rmount", "") }, /* 72 */
4822 + { 0, Ukn ITR(1, "rumount", "") }, /* 73 */
4823 + { 0, Ukn ITR(1, "rfstart", "") }, /* 74 */
4824 + { 0, Ukn ITR(1, "?", "") }, /* 75 */
4825 + { 0, Ukn ITR(1, "rdebug", "") }, /* 76 */
4826 + { 0, Ukn ITR(1, "rfstop", "") }, /* 77 */
4827 + { 0, Ukn ITR(1, "rfsys", "") }, /* 78 */
4828 + { sys_rmdir, 1 ITR(0, "rmdir", "s") }, /* 79 */
4829 + { abi_mkdir, 2 ITR(0, "mkdir", "so") }, /* 80 */
4830 + { svr4_getdents, 3 ITR(0, "getdents", "dxd") }, /* 81 */
4831 + { 0, Ukn ITR(1, "libattach", "") }, /* 82 */
4832 + { 0, Ukn ITR(1, "libdetach", "") }, /* 83 */
4833 + { svr4_sysfs, 3 ITR(0, "sysfs", "dxx") }, /* 84 */
4834 + { svr4_getmsg, Spl ITR(0, "getmsg", "dxxx") }, /* 85 */
4835 + { svr4_putmsg, Spl ITR(0, "putmsg", "dxxd") }, /* 86 */
4836 + { sys_poll, 3 ITR(0, "poll", "xdd") }, /* 87 */
4837 + { svr4_lstat, 2 ITR(0, "lstat", "sp") }, /* 88 */
4838 + { sys_symlink, 2 ITR(0, "symlink", "ss") }, /* 89 */
4839 + { sys_readlink, 3 ITR(0, "readlink", "spd") }, /* 90 */
4840 + { sys_setgroups, 2 ITR(0, "setgroups", "dp") }, /* 91 */
4841 + { sys_getgroups, 2 ITR(0, "getgroups", "dp") }, /* 92 */
4842 + { sys_fchmod, 2 ITR(0, "fchmod", "do") }, /* 93 */
4843 + { sys_fchown, 3 ITR(0, "fchown", "ddd") }, /* 94 */
4844 + { abi_sigprocmask, 3 ITR(0, "sigprocmask", "dxx") }, /* 95 */
4845 + { abi_sigsuspend, Spl ITR(0, "sigsuspend", "x") }, /* 96 */
4846 + { 0, 2 ITR(1, "sigaltstack", "xx") }, /* 97 */
4847 + { abi_sigaction, 3 ITR(0, "sigaction", "dxx") }, /* 98 */
4848 + { svr4_sigpending, 2 ITR(1, "sigpending", "dp") }, /* 99 */
4849 + { svr4_context, Spl ITR(0, "context", "") }, /* 100 */
4850 + { 0, Ukn ITR(1, "evsys", "") }, /* 101 */
4851 + { 0, Ukn ITR(1, "evtrapret", "") }, /* 102 */
4852 + { svr4_statvfs, 2 ITR(0, "statvfs", "sp") }, /* 103 */
4853 + { svr4_fstatvfs, 2 ITR(0, "fstatvfs", "dp") }, /* 104 */
4854 + { 0, Ukn ITR(0, "sysisc", "") }, /* 105 */
4855 + { 0, Ukn ITR(1, "nfssys", "") }, /* 106 */
4856 + { 0, 4 ITR(0, "waitid", "ddxd") }, /* 107 */
4857 + { 0, 3 ITR(1, "sigsendsys", "ddd") }, /* 108 */
4858 + { svr4_hrtsys, Spl ITR(0, "hrtsys", "xxx") }, /* 109 */
4859 + { 0, 3 ITR(1, "acancel", "dxd") }, /* 110 */
4860 + { 0, Ukn ITR(1, "async", "") }, /* 111 */
4861 + { 0, Ukn ITR(1, "priocntlsys", "") }, /* 112 */
4862 + { svr4_pathconf, 2 ITR(1, "pathconf", "sd") }, /* 113 */
4863 + { 0, 3 ITR(1, "mincore", "xdx") }, /* 114 */
4864 + { svr4_mmap, 6 ITR(0, "mmap", "xxxxdx") },/* 115 */
4865 + { sys_mprotect, 3 ITR(0, "mprotect", "xdx") },/* 116 */
4866 + { sys_munmap, 2 ITR(0, "munmap", "xd") },/* 117 */
4867 + { svr4_fpathconf, 2 ITR(1, "fpathconf", "dd") }, /* 118 */
4868 + { abi_fork, Spl ITR(0, "vfork", "") }, /* 119 */
4869 + { sys_fchdir, 1 ITR(0, "fchdir", "d") }, /* 120 */
4870 + { sys_readv, 3 ITR(0, "readv", "dxd") }, /* 121 */
4871 + { sys_writev, 3 ITR(0, "writev", "dxd") }, /* 122 */
4872 + { svr4_xstat, 3 ITR(0, "xstat", "dsx") }, /* 123 */
4873 + { svr4_lxstat, 3 ITR(0, "lxstat", "dsx") }, /* 124 */
4874 + { svr4_fxstat, 3 ITR(0, "fxstat", "ddx") }, /* 125 */
4875 + { svr4_xmknod, 4 ITR(0, "xmknod", "dsox")}, /* 126 */
4876 + { 0, Spl ITR(0, "syslocal", "d") }, /* 127 */
4877 + { svr4_getrlimit, 2 ITR(0, "setrlimit", "dx") }, /* 128 */
4878 + { svr4_setrlimit, 2 ITR(0, "getrlimit", "dx") }, /* 129 */
4879 + { 0, 3 ITR(1, "lchown", "sdd") }, /* 130 */
4880 + { 0, Ukn ITR(1, "memcntl", "") }, /* 131 */
4881 +#ifdef CONFIG_ABI_XTI
4882 + { svr4_getpmsg, 5 ITR(0, "getpmsg", "dxxxx")}, /* 132 */
4883 + { svr4_putpmsg, 5 ITR(0, "putpmsg", "dxxdd")}, /* 133 */
4885 + { 0, 5 ITR(0, "getpmsg", "dxxxx")}, /* 132 */
4886 + { 0, 5 ITR(0, "putpmsg", "dxxdd")}, /* 133 */
4888 + { sys_rename, 2 ITR(0, "rename", "ss") }, /* 134 */
4889 + { abi_utsname, 1 ITR(0, "uname", "x") }, /* 135 */
4890 + { svr4_setegid, 1 ITR(1, "setegid", "d") }, /* 136 */
4891 + { svr4_sysconfig, 1 ITR(0, "sysconfig", "d") }, /* 137 */
4892 + { 0, Ukn ITR(1, "adjtime", "") }, /* 138 */
4893 + { svr4_sysinfo, 3 ITR(0, "systeminfo", "dsd") }, /* 139 */
4894 + { socksys_syscall, 1 ITR(0, "socksys_syscall","x") }, /* 140 */
4895 + { svr4_seteuid, 1 ITR(1, "seteuid", "d") }, /* 141 */
4896 + { 0, Ukn ITR(1, "vtrace", "") }, /* 142 */
4897 + { 0, Ukn ITR(1, "fork1", "") }, /* 143 */
4898 + { 0, Ukn ITR(1, "sigtimedwait", "") }, /* 144 */
4899 + { 0, Ukn ITR(1, "lwp_info", "") }, /* 145 */
4900 + { 0, Ukn ITR(1, "yield", "") }, /* 146 */
4901 + { 0, Ukn ITR(1, "lwp_sema_wait", "") }, /* 147 */
4902 + { 0, Ukn ITR(1, "lwp_sema_post", "") }, /* 148 */
4903 + { 0, Ukn ITR(1, "lwp_sema_trywait","") }, /* 149 */
4904 + { 0, Ukn ITR(1, "?", "") }, /* 150 */
4905 + { 0, Ukn ITR(1, "?", "") }, /* 151 */
4906 + { 0, Ukn ITR(1, "modctl", "") }, /* 152 */
4907 + { 0, Ukn ITR(1, "fchroot", "") }, /* 153 */
4908 + { 0, Ukn ITR(1, "utimes", "") }, /* 154 */
4909 + { 0, Ukn ITR(1, "vhangup", "") }, /* 155 */
4910 + { sys_gettimeofday, 2 ITR(0, "gettimeofday", "xx") }, /* 156 */
4911 + { sys_getitimer, 2 ITR(0, "getitimer", "dx") }, /* 157 */
4912 + { sys_setitimer, 3 ITR(0, "setitimer", "dxx") }, /* 158 */
4913 + { 0, Ukn ITR(1, "lwp_create", "") }, /* 159 */
4914 + { 0, Ukn ITR(1, "lwp_exit", "") }, /* 160 */
4915 + { 0, Ukn ITR(1, "lwp_suspend", "") }, /* 161 */
4916 + { 0, Ukn ITR(1, "lwp_continue", "") }, /* 162 */
4917 + { 0, Ukn ITR(1, "lwp_kill", "") }, /* 163 */
4918 + { 0, Ukn ITR(1, "lwp_self", "") }, /* 164 */
4919 + { 0, Ukn ITR(1, "lwp_setprivate","") }, /* 165 */
4920 + { 0, Ukn ITR(1, "lwp_getprivate","") }, /* 166 */
4921 + { 0, Ukn ITR(1, "lwp_wait", "") }, /* 167 */
4922 + { 0, Ukn ITR(1, "lwp_mutex_unlock","") }, /* 168 */
4923 + { 0, Ukn ITR(1, "lwp_mutex_lock","") }, /* 169 */
4924 + { 0, Ukn ITR(1, "lwp_cond_wait", "") }, /* 170 */
4925 + { 0, Ukn ITR(1, "lwp_cond_signal","") }, /* 171 */
4926 + { 0, Ukn ITR(1, "lwp_cond_broadcast","") }, /* 172 */
4927 + { sys_pread64, -4 ITR(1, "pread", "dpdd") }, /* 173 */
4928 + { sys_pwrite64, -4 ITR(1, "pwrite", "dpdd") }, /* 174 */
4929 + { sol_llseek, Spl ITR(1, "llseek", "dxxd") }, /* 175 */
4930 + { 0, Ukn ITR(1, "inst_sync", "") }, /* 176 */
4931 + { 0, Ukn ITR(1, "?", "") }, /* 177 */
4932 + { 0, Ukn ITR(1, "kaio", "") }, /* 178 */
4933 + { 0, Ukn ITR(1, "?", "") }, /* 179 */
4934 + { 0, Ukn ITR(1, "?", "") }, /* 180 */
4935 + { 0, Ukn ITR(1, "?", "") }, /* 181 */
4936 + { 0, Ukn ITR(1, "?", "") }, /* 182 */
4937 + { 0, Ukn ITR(1, "?", "") }, /* 183 */
4938 + { 0, Ukn ITR(1, "tsolsys", "") }, /* 184 */
4939 + { sol_acl, 4 ITR(1, "acl", "sddp") }, /* 185 */
4940 + { 0, Ukn ITR(1, "auditsys", "") }, /* 186 */
4941 + { 0, Ukn ITR(1, "processor_bind","") }, /* 187 */
4942 + { 0, Ukn ITR(1, "processor_info","") }, /* 188 */
4943 + { 0, Ukn ITR(1, "p_online", "") }, /* 189 */
4944 + { 0, Ukn ITR(1, "sigqueue", "") }, /* 190 */
4945 + { 0, Ukn ITR(1, "clock_gettime", "") }, /* 191 */
4946 + { 0, Ukn ITR(1, "clock_settime", "") }, /* 192 */
4947 + { 0, Ukn ITR(1, "clock_getres", "") }, /* 193 */
4948 + { 0, Ukn ITR(1, "timer_create", "") }, /* 194 */
4949 + { 0, Ukn ITR(1, "timer_delete", "") }, /* 195 */
4950 + { 0, Ukn ITR(1, "timer_settime", "") }, /* 196 */
4951 + { 0, Ukn ITR(1, "timer_gettime", "") }, /* 197 */
4952 + { 0, Ukn ITR(1, "timer_getoverrun","") }, /* 198 */
4953 + { sys_nanosleep, 2 ITR(1, "nanosleep", "pp") }, /* 199 */
4954 + { 0, Ukn ITR(1, "modstat", "") }, /* 200 */
4955 + { 0, Ukn ITR(1, "facl", "") }, /* 201 */
4956 + { sys_setreuid, 2 ITR(1, "setreuid", "dd") }, /* 202 */
4957 + { sys_setregid, 2 ITR(1, "setregid", "dd") }, /* 203 */
4958 + { 0, Ukn ITR(1, "install_utrap", "") }, /* 204 */
4959 + { 0, Ukn ITR(1, "signotify", "") }, /* 205 */
4960 + { 0, Ukn ITR(1, "schedctl", "") }, /* 206 */
4961 + { 0, Ukn ITR(1, "pset", "") }, /* 207 */
4962 + { 0, Ukn ITR(1, "?", "") }, /* 208 */
4963 + { 0, Ukn ITR(1, "resolvepath", "") }, /* 209 */
4964 + { 0, Ukn ITR(1, "signotifywait", "") }, /* 210 */
4965 + { 0, Ukn ITR(1, "lwp_sigredirect","") }, /* 211 */
4966 + { 0, Ukn ITR(1, "lwp_alarm", "") }, /* 212 */
4967 + { sol_getdents64, 3 ITR(0, "getdents64", "dxd") }, /* 213 */
4968 + { sol_mmap64, 7 ITR(1, "mmap64", "pxdddxx")}, /*214 */
4969 + { sol_stat64, 2 ITR(0, "stat64", "sp") }, /* 215 */
4970 + { sol_lstat64, 2 ITR(0, "lstat64", "sp") }, /* 216 */
4971 + { sol_fstat64, 2 ITR(0, "fstat64", "dp") }, /* 217 */
4972 + { 0, Ukn ITR(1, "statvfs64", "") }, /* 218 */
4973 + { 0, Ukn ITR(1, "fstatvfs64", "") }, /* 219 */
4974 + { 0, Ukn ITR(1, "setrlimit64", "") }, /* 220 */
4975 + { 0, Ukn ITR(1, "getrlimit64", "") }, /* 221 */
4976 + { 0, Ukn ITR(1, "pread64", "") }, /* 222 */
4977 + { 0, Ukn ITR(1, "pwrite64", "") }, /* 223 */
4978 + { 0, Ukn ITR(1, "creat64", "") }, /* 224 */
4979 + { sol_open64, 3 ITR(0, "open64", "soo") }, /* 225 */
4980 + { 0, Ukn ITR(1, "rpcsys", "") }, /* 226 */
4981 + { 0, Ukn ITR(1, "?", "") }, /* 227 */
4982 + { 0, Ukn ITR(1, "?", "") }, /* 228 */
4983 + { 0, Ukn ITR(1, "?", "") }, /* 229 */
4984 + { solaris_socket, 3 ITR(1, "so_socket", "ddd") }, /* 230 */
4985 + { solaris_socketpair,1 ITR(1, "so_socketpair", "dddx") }, /* 231 */
4986 + { solaris_bind, 3 ITR(1, "bind", "dxd") }, /* 232 */
4987 + { solaris_listen, 2 ITR(1, "listen", "dd") }, /* 233 */
4988 + { solaris_accept, 3 ITR(1, "accept", "dxx") }, /* 234 */
4989 + { solaris_connect, 3 ITR(1, "connect", "dxd") }, /* 235 */
4990 + { solaris_shutdown, 2 ITR(1, "shutdown", "dd") }, /* 236 */
4991 + { solaris_recv, 4 ITR(1, "recv", "dxdd") }, /* 237 */
4992 + { solaris_recvfrom, 6 ITR(1, "recvfrom", "dxddxd")}, /* 238 */
4993 + { solaris_recvmsg, 3 ITR(1, "recvmsg", "dxd") }, /* 239 */
4994 + { solaris_send, 4 ITR(1, "send", "dxdd") }, /* 240 */
4995 + { solaris_sendmsg, 3 ITR(0, "sendmsg", "dxd") }, /* 241 */
4996 + { solaris_sendto, 6 ITR(1, "sendto", "dxddxd")}, /* 242 */
4997 + { solaris_getpeername,3 ITR(1, "getpeername", "dxx") }, /* 243 */
4998 + { solaris_getsockname,3 ITR(1, "getsockname", "dxx") }, /* 244 */
4999 + { solaris_getsockopt,5 ITR(1, "getsockopt", "dddxx")}, /* 245 */
5000 + { solaris_setsockopt,5 ITR(1, "setsockopt", "dddxd")}, /* 246 */
5001 + { 0, Ukn ITR(1, "sockconfig", "") }, /* 247 */
5002 + { 0, Ukn ITR(1, "ntp_gettime", "") }, /* 248 */
5003 + { 0, Ukn ITR(0, "ntp_adjtime", "") }, /* 249 */
5004 + { 0, Ukn ITR(1, "?", "") }, /* 250 */
5005 + { 0, Ukn ITR(1, "?", "") }, /* 251 */
5006 + { 0, Ukn ITR(1, "?", "") }, /* 252 */
5007 + { 0, Ukn ITR(1, "?", "") }, /* 253 */
5008 + { 0, Ukn ITR(1, "?", "") }, /* 254 */
5009 + { 0, Ukn ITR(1, "?", "") } /* 255 */
5012 +static void solaris_lcall7(int segment, struct pt_regs * regs)
5014 + int sysno = regs->eax & 0xff;
5016 + if (sysno >= ARRAY_SIZE(solaris_syscall_table))
5017 + set_error(regs, iABI_errors(-EINVAL));
5019 + lcall7_dispatch(regs, &solaris_syscall_table[sysno], 1);
5022 +static struct exec_domain solaris_exec_domain = {
5024 + handler: solaris_lcall7,
5025 + pers_low: 13 /* PER_SOLARIS */,
5026 + pers_high: 13 /* PER_SOLARIS */,
5027 + signal_map: solaris_to_linux_signals,
5028 + signal_invmap: linux_to_solaris_signals,
5029 + err_map: solaris_err_map,
5030 + socktype_map: solaris_socktype_map,
5031 + sockopt_map: solaris_sockopt_map,
5032 + af_map: solaris_af_map,
5033 + module: THIS_MODULE,
5037 +static void __exit solaris_cleanup(void)
5039 + unregister_exec_domain(&solaris_exec_domain);
5042 +static int __init solaris_init(void)
5044 + return register_exec_domain(&solaris_exec_domain);
5047 +module_init(solaris_init);
5048 +module_exit(solaris_cleanup);
5049 diff -Nru linux-2.6.7/abi/svr4/consio.c linux-2.6.7-abi/abi/svr4/consio.c
5050 --- linux-2.6.7/abi/svr4/consio.c 1970-01-01 01:00:00.000000000 +0100
5051 +++ linux-2.6.7-abi/abi/svr4/consio.c 2004-07-22 17:44:20.000000000 +0200
5055 +#include <linux/errno.h>
5056 +#include <linux/kernel.h>
5057 +#include <linux/types.h>
5058 +#include <linux/module.h>
5062 +svr4_console_ioctl(int fd, u_int cmd, caddr_t data)
5065 + case 0x6301: /* CONS_CURRENT: Get display adapter type */
5066 + case 0x6302: /* CONS_GET: Get display mode setting */
5068 + * Always error so the application never tries
5069 + * anything overly fancy on the console.
5072 + case 0x4304: /* _TTYDEVTYPE */
5073 + /* If on console then 1, if pseudo tty then 2 */
5077 + printk(KERN_ERR "iBCS: console ioctl %d unsupported\n", cmd);
5082 +svr4_video_ioctl(int fd, u_int cmd, caddr_t data)
5085 + case 1: /* MAP_CLASS */
5086 + /* Get video memory map & IO privilege */
5089 + /* This doesn't agree with my SCO 3.2.4 ???? */
5090 + case 4: /* C_IOC */
5091 + /* see /etc/conf/pack.d/cn/class.h on any SCO unix box :-) */
5098 + printk(KERN_ERR "iBCS: video ioctl %d unsupported\n", cmd);
5102 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
5103 +EXPORT_SYMBOL(svr4_console_ioctl);
5104 +EXPORT_SYMBOL(svr4_video_ioctl);
5106 diff -Nru linux-2.6.7/abi/svr4/fcntl.c linux-2.6.7-abi/abi/svr4/fcntl.c
5107 --- linux-2.6.7/abi/svr4/fcntl.c 1970-01-01 01:00:00.000000000 +0100
5108 +++ linux-2.6.7-abi/abi/svr4/fcntl.c 2004-07-22 17:44:20.000000000 +0200
5111 + * Copyright (c) 2002 Caldera Deutschland GmbH.
5112 + * All rights reserved.
5114 + * This program is free software; you can redistribute it and/or modify
5115 + * it under the terms of the GNU General Public License as published by
5116 + * the Free Software Foundation; either version 2 of the License, or
5117 + * (at your option) any later version.
5119 + * This program is distributed in the hope that it will be useful,
5120 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
5121 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5122 + * GNU General Public License for more details.
5124 + * You should have received a copy of the GNU General Public License
5125 + * along with this program; if not, write to the Free Software
5126 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
5129 +#ident "@(#)fcntl.c 1.1 02/23/02"
5131 +#include <linux/types.h>
5132 +#include <linux/errno.h>
5133 +#include <linux/fcntl.h>
5134 +#include <linux/sched.h>
5135 +#include <linux/kernel.h>
5136 +#include <linux/syscalls.h>
5137 +#include <linux/module.h>
5139 +#include <asm/uaccess.h>
5140 +#include <asm/ioctls.h>
5142 +#include <abi/svr4/types.h>
5143 +#include <abi/util/trace.h>
5144 +#include <abi/util/map.h>
5147 +struct svr4_flock {
5148 + int16_t l_type; /* numbers don't match */
5150 + svr4_off_t l_start;
5151 + svr4_off_t l_len; /* 0 means to end of file */
5158 + * ISC (at least) assumes O_CREAT if O_TRUNC is given.
5159 + * This is emulated here but is it correct for SVR4 in general?
5161 +unsigned short fl_svr4_to_linux[] = {
5162 + 0x0001, 0x0002, 0x0800, 0x0400, 0x1000, 0x0000, 0x0000, 0x0800,
5163 + 0x0040, 0x0240, 0x0080, 0x0100, 0x0000, 0x0000, 0x0000, 0x0000
5166 +unsigned short fl_linux_to_svr4[] = {
5167 + 0x0001, 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0100, 0x0400,
5168 + 0x0800, 0x0200, 0x0008, 0x0004, 0x0010, 0x0000, 0x0000, 0x0000
5171 +static inline int svr4_fcntl_flock(int fd, unsigned int cmd, unsigned long arg)
5173 + struct svr4_flock fl, *flp = (struct svr4_flock *)arg;
5174 + struct flock l_fl;
5179 + * We are not supposed to fail once the lock is set,
5180 + * thus we check the userspace pointer for writeaccess now.
5182 + rval = verify_area(VERIFY_WRITE, flp, sizeof(struct svr4_flock));
5186 + rval = copy_from_user(&fl, flp, sizeof(struct svr4_flock));
5190 + l_fl.l_type = fl.l_type - 1;
5191 + l_fl.l_whence = fl.l_whence;
5192 + l_fl.l_start = fl.l_start;
5193 + l_fl.l_len = fl.l_len;
5194 + l_fl.l_pid = fl.l_pid;
5196 +#if defined(CONFIG_ABI_TRACE)
5197 + abi_trace(ABI_TRACE_API,
5198 + "lock l_type: %d l_whence: %d "
5199 + "l_start: %u l_len: %u "
5200 + "l_sysid: %d l_pid: %d\n",
5201 + fl.l_type, fl.l_whence,
5202 + fl.l_start, fl.l_len,
5203 + fl.l_sysid, fl.l_pid);
5208 + rval = sys_fcntl(fd, cmd, (unsigned long)&l_fl);
5214 + fl.l_type = l_fl.l_type + 1;
5215 + fl.l_whence = l_fl.l_whence;
5216 + fl.l_start = l_fl.l_start;
5217 + fl.l_len = l_fl.l_len;
5219 + fl.l_pid = l_fl.l_pid;
5221 + __copy_to_user(flp, &fl, sizeof(struct svr4_flock));
5225 +int svr4_fcntl(int fd, unsigned int cmd, unsigned long arg)
5230 + case 0: /* F_DUPFD */
5231 + case 1: /* F_GETFD */
5232 + case 2: /* F_SETFD */
5233 + return sys_fcntl(fd, cmd, arg);
5234 + case 3: /* F_GETFL */
5235 + rval = sys_fcntl(fd, cmd, arg);
5236 + return map_flags(rval, fl_linux_to_svr4);
5237 + case 4: /* F_SETFL */
5238 + arg = map_flags(arg, fl_svr4_to_linux);
5239 + return sys_fcntl(fd, cmd, arg);
5240 + case 14: /* F_GETLK SVR4 */
5243 + case 5: /* F_GETLK */
5244 + case 6: /* F_SETLK */
5245 + case 7: /* F_SETLKW */
5246 + return svr4_fcntl_flock(fd, cmd, arg);
5247 + case 10: /* F_ALLOCSP */
5248 + /* Extend allocation for specified portion of file. */
5250 + case 11: /* F_FREESP */
5251 + /* Free a portion of a file. */
5255 + * These are intended to support the Xenix chsize() and
5256 + * rdchk() system calls. I don't know if these may be
5257 + * generated by applications or not.
5259 + case 0x6000: /* F_CHSIZE */
5260 + return sys_ftruncate(fd, arg);
5261 + case 0x6001: /* F_RDCHK */
5268 + rval = sys_ioctl(fd, FIONREAD, (long)&nbytes);
5273 + return (nbytes ? 1 : 0);
5276 + case 8: /* F_CHKFL */
5280 + * These are made from the Xenix locking() system call.
5281 + * According to available documentation these would
5282 + * never be generated by an application - only by the
5283 + * kernel Xenix support.
5285 + case 0x6300: /* F_LK_UNLCK */
5286 + case 0x7200: /* F_LK_LOCK */
5287 + case 0x6200: /* F_LK_NBLCK */
5288 + case 0x7100: /* F_LK_RLCK */
5289 + case 0x6100: /* F_LK_NBRLCK */
5293 +#if defined(CONFIG_ABI_TRACE)
5294 + abi_trace(ABI_TRACE_API,
5295 + "unsupported fcntl 0x%x, arg 0x%lx\n", cmd, arg);
5301 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
5302 +EXPORT_SYMBOL(fl_svr4_to_linux);
5303 +EXPORT_SYMBOL(svr4_fcntl);
5305 diff -Nru linux-2.6.7/abi/svr4/filio.c linux-2.6.7-abi/abi/svr4/filio.c
5306 --- linux-2.6.7/abi/svr4/filio.c 1970-01-01 01:00:00.000000000 +0100
5307 +++ linux-2.6.7-abi/abi/svr4/filio.c 2004-07-22 17:44:20.000000000 +0200
5310 + * Copyright (c) 2001 Christoph Hellwig.
5311 + * All rights reserved.
5313 + * This program is free software; you can redistribute it and/or modify
5314 + * it under the terms of the GNU General Public License as published by
5315 + * the Free Software Foundation; either version 2 of the License, or
5316 + * (at your option) any later version.
5318 + * This program is distributed in the hope that it will be useful,
5319 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
5320 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5321 + * GNU General Public License for more details.
5323 + * You should have received a copy of the GNU General Public License
5324 + * along with this program; if not, write to the Free Software
5325 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
5331 + * SVR4 file ioctls.
5334 +#include <linux/sched.h>
5335 +#include <linux/file.h>
5336 +#include <linux/sockios.h>
5337 +#include <linux/syscalls.h>
5338 +#include <linux/module.h>
5340 +#include <asm/uaccess.h>
5341 +#include <asm/ioctls.h>
5343 +#include <abi/ioctl.h>
5347 +svr4_fil_ioctl(int fd, u_int cmd, caddr_t data)
5351 + case BSD__IOV('f', 1):
5352 + case BSD__IO('f', 1):
5353 + FD_SET(fd, current->files->close_on_exec);
5357 + case BSD__IOV('f', 2):
5358 + case BSD__IO('f', 2):
5359 + FD_CLR(fd, current->files->close_on_exec);
5362 + case BSD__IOV('f', 3):
5363 + case BSD__IO('f', 3): {
5364 + int error, nbytes;
5369 + error = sys_ioctl(fd, FIONREAD, (long)&nbytes);
5372 + return (error <= 0 ? error : nbytes);
5376 + case BSD__IOW('f', 123, int):
5377 + return sys_ioctl(fd, FIOGETOWN, (long)data);
5380 + case BSD__IOW('f', 124, int):
5381 + return sys_ioctl(fd, FIOSETOWN, (long)data);
5384 + case BSD__IOW('f', 125, int):
5385 + return sys_ioctl(fd, FIOASYNC, (long)data);
5388 + case BSD__IOW('f', 126, int):
5389 + return sys_ioctl(fd, FIONBIO, (long)data);
5392 + case BSD__IOR('f', 127, int):
5393 + return sys_ioctl(fd, FIONREAD, (long)data);
5396 + printk(KERN_ERR "%s: file ioctl 0x%08x unsupported\n", __FUNCTION__, cmd);
5400 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
5401 +EXPORT_SYMBOL(svr4_fil_ioctl);
5403 diff -Nru linux-2.6.7/abi/svr4/hrtsys.c linux-2.6.7-abi/abi/svr4/hrtsys.c
5404 --- linux-2.6.7/abi/svr4/hrtsys.c 1970-01-01 01:00:00.000000000 +0100
5405 +++ linux-2.6.7-abi/abi/svr4/hrtsys.c 2004-07-22 17:44:20.000000000 +0200
5408 + * Copyright (C) 1994 Eric Youngdale.
5410 + * The hrtsys interface is used by SVR4, and is effectively a way of doing
5411 + * itimer. I do not know why this is used instead of the regular itimer
5412 + * stuff, but it appears to be related to bsd programs/functionality.
5417 +#include <linux/module.h>
5418 +#include <linux/ptrace.h>
5419 +#include <linux/errno.h>
5420 +#include <linux/mm.h>
5421 +#include <linux/string.h>
5422 +#include <linux/syscalls.h>
5423 +#include <asm/uaccess.h>
5425 +#include <asm/abi_machdep.h>
5426 +#include <abi/util/trace.h>
5429 +struct hrt_time_t {
5430 + unsigned long secs;
5431 + unsigned long sub_sec; /* Less than one second. */
5432 + unsigned long resolution; /* Resolution of timer */
5438 + struct hrt_time_t interval;
5439 + struct hrt_time_t tod;
5446 +ibcs_hrtcntl (struct pt_regs * regs)
5448 + unsigned int param[4];
5449 + struct timeval * tv;
5452 + for (i=0; i<4; i++)
5453 + param[i] = get_syscall_parameter (regs, 1+i);
5455 + if (param[0] != 1 || param[1] != 1 || param[2] != 0)
5458 + tv = (struct timeval *) param[3];
5460 +#if defined(CONFIG_ABI_TRACE)
5461 + abi_trace(ABI_TRACE_API, "hrtcntl(0x%lx)\n", (u_long)tv);
5464 + error = verify_area(VERIFY_WRITE, (char *) tv,sizeof *tv);
5468 + return sys_gettimeofday(tv, NULL);
5472 +ibcs_hrtalarm (struct pt_regs * regs)
5474 + struct itimerval get_buffer;
5475 + struct hrtcmd * hcmd;
5476 + int i, error, cmd, retval, which;
5477 + mm_segment_t old_fs = get_fs();
5479 + i = get_syscall_parameter (regs, 2);
5483 + hcmd = (struct hrtcmd *) get_syscall_parameter (regs, 1);
5485 + error = verify_area (VERIFY_WRITE, (char *) hcmd,sizeof *hcmd);
5489 + get_user (cmd, ((unsigned long *) hcmd));
5491 + /* Now figure out which clock we want to fiddle with */
5492 + get_user (which, ((unsigned long *) hcmd)+1);
5494 +#if defined(CONFIG_ABI_TRACE)
5495 + abi_trace(ABI_TRACE_API, "hrtalarm(0x%lx %d)\n",
5496 + (u_long)cmd, which);
5515 + if(({long r; get_user(r, ((unsigned long *) hcmd)+4); r;}) != 1000000)
5517 + copy_from_user(&get_buffer.it_value, ((unsigned long *) hcmd)+2,
5518 + sizeof(struct timeval));
5519 + memset(&get_buffer.it_interval, 0, sizeof(struct timeval));
5521 + retval = sys_setitimer(which, &get_buffer, NULL);
5526 + retval = sys_getitimer(which, &get_buffer);
5529 +#if defined(CONFIG_ABI_TRACE)
5530 + abi_trace(ABI_TRACE_API, "hrtalarm(d %lx) %lx %lx %lx %lx\n",
5532 + get_buffer.it_interval.tv_sec,
5533 + get_buffer.it_interval.tv_usec,
5534 + get_buffer.it_value.tv_sec,
5535 + get_buffer.it_value.tv_usec);
5538 + put_user(1000000, &hcmd->interval.resolution);
5539 + copy_to_user(((unsigned long *) hcmd)+2, &get_buffer.it_interval,
5540 + sizeof(get_buffer));
5544 + if(({long r; get_user(r, ((unsigned long *) hcmd)+4); r;}) != 1000000)
5546 + if(({long r; get_user(r, ((unsigned long *) hcmd)+7); r;}) != 1000000)
5548 + copy_from_user(&get_buffer.it_value, &hcmd->tod,
5549 + sizeof(struct timeval));
5550 + copy_from_user(&get_buffer.it_interval, &hcmd->interval,
5551 + sizeof(struct timeval));
5553 + retval = sys_setitimer(which, &get_buffer, NULL);
5557 + memset(&get_buffer, 0, sizeof(get_buffer));
5559 + retval = sys_setitimer(which, &get_buffer, NULL);
5570 +svr4_hrtsys (struct pt_regs * regs)
5574 + func = get_syscall_parameter (regs, 0);
5576 +#if defined(CONFIG_ABI_TRACE)
5577 + abi_trace(ABI_TRACE_API, "hrtsys(%d)\n", func);
5582 + retval = ibcs_hrtcntl(regs);
5585 + retval = ibcs_hrtalarm(regs);
5596 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
5597 +EXPORT_SYMBOL(svr4_hrtsys);
5599 diff -Nru linux-2.6.7/abi/svr4/ioctl.c linux-2.6.7-abi/abi/svr4/ioctl.c
5600 --- linux-2.6.7/abi/svr4/ioctl.c 1970-01-01 01:00:00.000000000 +0100
5601 +++ linux-2.6.7-abi/abi/svr4/ioctl.c 2004-07-22 17:44:20.000000000 +0200
5604 + * Copyright (C) 1991, 1992 Linus Torvalds
5606 + * Written by Drew Sullivan.
5607 + * Rewritten by Mike Jagdis.
5612 +#include <linux/config.h>
5613 +#include <linux/errno.h>
5614 +#include <linux/kernel.h>
5615 +#include <linux/module.h>
5616 +#include <linux/syscalls.h>
5617 +#include <asm/uaccess.h>
5619 +#include <asm/abi_machdep.h>
5620 +#include <abi/svr4/ioctl.h>
5624 + * __svr4_ioctl() is a meta mapper, that is
5625 + * it looks up the class of the ioctl and then
5626 + * dispatchs to lower level routines to handle the
5627 + * mapping of the actual ioctls
5630 +__svr4_ioctl(struct pt_regs *regs, int fd, unsigned long ioctl_num, void *arg)
5632 + unsigned int class = ioctl_num >> 8;
5633 + char class_str[4];
5638 + * SCO ioctls on the pseudo NFS device probably.
5641 + return abi_ioctl_socksys(fd, ioctl_num, arg);
5644 + * SCO console keyboard stuff?
5650 + return svr4_tape_ioctl(fd, ioctl_num, arg);
5653 + return svr4_fil_ioctl(fd, ioctl_num, arg);
5656 + * Xenix ioctl compatibility.
5659 + return svr4_term_ioctl(fd, ioctl_num & 0xFF, arg);
5663 + return svr4_console_ioctl(fd, ioctl_num, arg);
5665 + case ('i' << 16) | ('C' << 8): /* iBCS2 POSIX */
5666 + return svr4_video_ioctl(fd, ioctl_num & 0xFF, arg);
5669 + * SCO 3.2.2 uses ('X'<<8)|1 for access to the video map
5670 + * and the 'X' set is also used for synchronous comm
5671 + * lines (I think?). SVR4 uses it for tty extensions to
5672 + * support hardware flow control and external clocks.
5675 + return svr4_termiox_ioctl(fd, ioctl_num & 0xFF, arg);
5678 + * These aren't implemented and are never likely to be as they
5679 + * are specific to drivers for obscure hardware. (For those
5680 + * that don't know they're the JERQ ioctls. Says it all
5687 + * The 'S' set could also be display mode switch
5688 + * ioctls in a SCO 3.2.x x<4 environment. It should
5689 + * depend on the descriptor they are applied to.
5690 + * According to ISC the Xenix STREAMS ioctls had the
5691 + * high bit set on the command to differentiate them
5692 + * from mode switch ioctls. Yuk, yuk, yuk...
5695 + return svr4_stream_ioctl(regs, fd, ioctl_num & 0x7F, arg);
5698 + * These are STREAMS socket module ioctls.
5701 +#if defined(CONFIG_ABI_XTI)
5702 + return svr4_sockmod_ioctl(fd, ioctl_num & 0xFF, arg);
5708 + * EUC ioctls. These are something to do with chararcter
5709 + * code set conversions in SVR4. If we don't support
5710 + * them the correct thing to do is to return EINVAL.
5716 + * SCO channel mapping. I can't find any documentation
5717 + * for this. These are the LD?MAP ioctls defined in
5718 + * sys/termio.h and sys/emap.h. They are used by mapchan.
5725 + * If we haven't handled it yet it must be a BSD style ioctl
5726 + * with a (possible) argument description in the high word of
5729 + switch (class & 0xff) {
5732 + * From SVR4 as specified in sys/iocomm.h.
5735 + return svr4_fil_ioctl(fd, ioctl_num, arg);
5738 + * BSD or V7 terminal ioctls.
5741 + return bsd_ioctl_termios(fd, ioctl_num, arg);
5744 + * "Traditional" BSD and Wyse V/386 3.2.1A TCP/IP ioctls.
5749 + return abi_ioctl_socksys(fd, ioctl_num, arg);
5752 + * SVR3 streams based socket TCP/IP ioctls.
5754 + * These are handed over to the standard ioctl
5755 + * handler since /dev/socksys is an emulated device
5756 + * and front ends any sockets created through it.
5757 + * Note that 'S' ioctls without the BSDish argument
5758 + * type in the high bytes are STREAMS ioctls and 'I'
5759 + * ioctls without the BSDish type in the high bytes
5760 + * are the STREAMS socket module ioctls. (see above).
5765 + return abi_ioctl_socksys(fd, ioctl_num, arg);
5769 + * If nothing has handled it yet someone may have to do some
5772 + class_str[0] = class & 0xFF0000 ? (char)((class >> 16) & 0xFF) : '.';
5773 + class_str[1] = class & 0x00FF00 ? (char)((class >> 8) & 0xFF) : '.';
5774 + class_str[2] = class & 0x0000FF ? (char)((class ) & 0xFF) : '.';
5777 + printk(KERN_DEBUG "svr4: ioctl(%d, %lx[%s], 0x%p) unsupported\n",
5778 + fd, ioctl_num, class_str, arg);
5784 +svr4_ioctl(struct pt_regs * regs)
5790 + fd = (int)get_syscall_parameter(regs, 0);
5791 + num = (u_int)get_syscall_parameter(regs, 1);
5792 + data = (caddr_t)get_syscall_parameter(regs, 2);
5794 + return __svr4_ioctl(regs, fd, num, data);
5797 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
5798 +EXPORT_SYMBOL(__svr4_ioctl);
5799 +EXPORT_SYMBOL(svr4_ioctl);
5801 diff -Nru linux-2.6.7/abi/svr4/ipc.c linux-2.6.7-abi/abi/svr4/ipc.c
5802 --- linux-2.6.7/abi/svr4/ipc.c 1970-01-01 01:00:00.000000000 +0100
5803 +++ linux-2.6.7-abi/abi/svr4/ipc.c 2004-07-22 17:44:20.000000000 +0200
5806 + * Copyright (C) 1994 Mike Jagdis (jaggy@purplet.demon.co.uk)
5807 + * Copyright (C) 2001 Christoph Hellwig (hch@caldera.de)
5809 + * Massive work over with a fine tooth comb, lots of rewriting. There
5810 + * were a *lot* of bugs in this - mismatched structs that weren't
5811 + * mapped, wrong pointers etc. I've tested this version with the
5812 + * demo programs from the Wyse V/386 IPC documentation which exercise
5813 + * all the functions. I don't have any major IPC using applications
5814 + * to test it with - as far as I know...
5816 + * Again rewritten for Linux 2.4 - Linux 2.4 changes a lot of structures
5817 + * and the cruft this file relied on has simply changed...
5819 + * Original copyright etc. follows:
5821 + * Copyright (C) 1993,1994 Joe Portman (baron@hebron.connected.com)
5822 + * First stab at ibcs shm, sem and msg handlers
5825 + * Please contact the author above before blindly making changes
5826 + * to this file. You will break things.
5828 + * 04-15-1994 JLP III
5829 + * Still no msgsys, but IPC_STAT now works for shm calls
5830 + * Corrected argument order for sys_ipc calls, to accomodate Mike's
5831 + * changes, so that we can just call sys_ipc instead of the internal
5832 + * sys_* calls for ipc functions.
5833 + * Cleaned up translation of perm structures
5834 + * tstshm for Oracle now works.
5836 + * 04-23-1994 JLP III
5837 + * Added in msgsys calls, Tested and working
5838 + * Added translation for IPC_SET portions of all xxxctl functions.
5839 + * Added SHM_LOCK and SHM_UNLOCK to shmsys
5841 + * 04-28-1994 JLP III
5842 + * Special thanks to Brad Pepers for adding in the GETALL and SETALL
5843 + * case of semaphores. (pepersb@cuug.ab.ca)
5848 +#include <linux/module.h>
5849 +#include <linux/errno.h>
5850 +#include <linux/fs.h>
5851 +#include <linux/kernel.h>
5852 +#include <linux/personality.h>
5853 +#include <linux/ptrace.h>
5854 +#include <linux/sched.h>
5855 +#include <linux/string.h>
5856 +#define __KERNEL_SYSCALLS__
5857 +#include <linux/unistd.h>
5858 +#include <linux/syscalls.h>
5859 +#include <linux/ipc.h>
5860 +#include <linux/sem.h>
5861 +#include <linux/shm.h>
5862 +#include <linux/msg.h>
5864 +#include <asm/uaccess.h>
5865 +#include <asm/ipc.h>
5867 +#include <abi/svr4/ipc.h>
5868 +#include <abi/util/trace.h>
5869 +#include <abi/util/errno.h>
5872 +static __inline__ void
5873 +ip_to_lp(struct ibcs2_ipc_perm *ip, struct ipc_perm *lp)
5875 + lp->uid = ip->uid;
5876 + lp->gid = ip->gid;
5877 + lp->cuid = ip->cuid;
5878 + lp->cgid = ip->cgid;
5879 + lp->mode = ip->mode;
5880 + lp->seq = ip->seq;
5881 + lp->key = ip->key;
5884 +static __inline__ void
5885 +lp_to_ip(struct ipc_perm *lp, struct ibcs2_ipc_perm *ip)
5887 + ip->uid = lp->uid;
5888 + ip->gid = lp->gid;
5889 + ip->cuid = lp->cuid;
5890 + ip->cgid = lp->cgid;
5891 + ip->mode = lp->mode;
5892 + ip->seq = lp->seq;
5893 + ip->key = lp->key;
5896 +static __inline__ void
5897 +ip_to_lp_l(struct abi4_ipc_perm *ip, struct ipc_perm *lp)
5899 + lp->uid = ip->uid;
5900 + lp->gid = ip->gid;
5901 + lp->cuid = ip->cuid;
5902 + lp->cgid = ip->cgid;
5903 + lp->mode = ip->mode;
5904 + lp->seq = ip->seq;
5905 + lp->key = ip->key;
5908 +static __inline__ void
5909 +lp_to_ip_l(struct ipc_perm *lp, struct abi4_ipc_perm *ip)
5911 + ip->uid = lp->uid;
5912 + ip->gid = lp->gid;
5913 + ip->cuid = lp->cuid;
5914 + ip->cgid = lp->cgid;
5915 + ip->mode = lp->mode;
5916 + ip->seq = lp->seq;
5917 + ip->key = lp->key;
5921 +isem_to_lsem(struct ibcs2_semid_ds *is, struct semid_ds *ls)
5923 + ip_to_lp(&is->sem_perm, &ls->sem_perm);
5925 + ls->sem_base = is->sem_base;
5926 + ls->sem_nsems = is->sem_nsems;
5927 + ls->sem_otime = is->sem_otime;
5928 + ls->sem_ctime = is->sem_ctime;
5932 +lsem_to_isem(struct semid_ds *ls, struct ibcs2_semid_ds *is)
5934 + lp_to_ip(&ls->sem_perm, &is->sem_perm);
5936 + is->sem_base = ls->sem_base;
5937 + is->sem_nsems = ls->sem_nsems;
5938 + is->sem_otime = ls->sem_otime;
5939 + is->sem_ctime = ls->sem_ctime;
5943 +isem_to_lsem_l(struct abi4_semid_ds *is, struct semid_ds *ls)
5945 + ip_to_lp_l(&is->sem_perm, &ls->sem_perm);
5947 + ls->sem_base = is->sem_base;
5948 + ls->sem_nsems = is->sem_nsems;
5949 + ls->sem_otime = is->sem_otime;
5950 + ls->sem_ctime = is->sem_ctime;
5954 +lsem_to_isem_l(struct semid_ds *ls, struct abi4_semid_ds *is)
5956 + memset(is, 0, sizeof(*is));
5958 + lp_to_ip_l(&ls->sem_perm, &is->sem_perm);
5960 + is->sem_base = ls->sem_base;
5961 + is->sem_nsems = ls->sem_nsems;
5962 + is->sem_otime = ls->sem_otime;
5963 + is->sem_ctime = ls->sem_ctime;
5967 +__ibcs2_semctl(int first, int second, int third, union semun *fourth)
5969 + struct ibcs2_semid_ds is, *isp;
5970 + struct semid_ds ls;
5971 + union semun lsemun;
5975 + err = get_user(isp, (struct ibcs2_semid_ds **)&fourth->buf);
5979 + err = copy_from_user(&is, isp, sizeof(is)) ? -EFAULT : 0;
5983 + isem_to_lsem(&is, &ls);
5988 + err = sys_ipc(SEMCTL, first, second, third, &lsemun,0);
5994 + lsem_to_isem(&ls, &is);
5995 + return copy_to_user(isp, &is, sizeof(is)) ? -EFAULT : 0;
5999 +__abi4_semctl(int first, int second, int third, union semun *fourth)
6001 + struct abi4_semid_ds is, *isp;
6002 + struct semid_ds ls;
6003 + union semun lsemun;
6007 + err = get_user(isp, (struct abi4_semid_ds **)&fourth->buf);
6011 + err = copy_from_user(&is, isp, sizeof(is)) ? -EFAULT : 0;
6015 + isem_to_lsem_l(&is, &ls);
6020 + err = sys_ipc(SEMCTL, first, second, third, &lsemun,0);
6026 + lsem_to_isem_l(&ls, &is);
6027 + return copy_to_user(isp, &is, sizeof(is)) ? -EFAULT : 0;
6031 +svr4_semctl(int arg1, int arg2, int arg3, union semun *arg4)
6033 + int cmd = svr4sem2linux[arg3];
6036 + case SVR4_SEM_SETALL:
6037 + case SVR4_SEM_GETALL:
6038 + return __ibcs2_semctl(arg1, 0, cmd, arg4);
6039 + case SVR4_IPC_RMID:
6040 + case SVR4_IPC_RMID_L:
6041 + case SVR4_SEM_SETVAL:
6042 + case SVR4_SEM_GETVAL:
6043 + case SVR4_SEM_GETPID:
6044 + case SVR4_SEM_GETNCNT:
6045 + case SVR4_SEM_GETZCNT:
6046 + return sys_ipc(SEMCTL, arg1, arg2, cmd, arg4, 0);
6047 + case SVR4_IPC_SET:
6048 + case SVR4_IPC_STAT:
6049 + return __ibcs2_semctl(arg1, arg2, cmd, arg4);
6050 + case SVR4_IPC_STAT_L:
6051 + case SVR4_IPC_SET_L:
6052 + return __abi4_semctl(arg1, arg2, cmd, arg4);
6055 + __abi_trace("semctl: unsupported command %d\n", arg3);
6060 +svr4_semget(int arg1, int arg2, int arg3)
6062 +#if defined(CONFIG_ABI_TRACE)
6063 + abi_trace(ABI_TRACE_API, "semget(%d, %d, %o)\n", arg1, arg2, arg3);
6065 + return sys_semget(arg1, arg2, arg3);
6070 +svr4_semop(int arg1, struct sembuf *arg2, int arg3)
6072 +#if defined(CONFIG_ABI_TRACE)
6073 + if (abi_traced(ABI_TRACE_API)) {
6074 + struct sembuf tmp, *tp = arg2;
6077 + for (i = 0; i < arg3; i++) {
6078 + copy_from_user (&tmp, tp, sizeof(tmp));
6079 + __abi_trace("semop(%d, %d, 0%o)\n",
6080 + tmp.sem_num, tmp.sem_op,
6087 + return sys_semop(arg1, arg2, arg3);
6091 +svr4_semsys(struct pt_regs *regp)
6093 + int which, arg1, arg2, arg3;
6094 + union semun *arg4;
6096 + which = get_syscall_parameter(regp, 0);
6097 + arg1 = get_syscall_parameter(regp, 1);
6098 + arg2 = get_syscall_parameter(regp, 2);
6099 + arg3 = get_syscall_parameter(regp, 3);
6102 + * XXX - The value for arg4 depends on how union
6103 + * passing is implement on this architecture and
6104 + * compiler. The following is *only* known to be
6105 + * right for Intel (the default else case).
6108 + arg4 = (union semun *)get_syscall_parameter(regp, 4);
6110 + arg4 = (union semun *)(((u_long *)regp->esp) + (5));
6115 + return svr4_semctl(arg1, arg2, arg3, arg4);
6117 + return svr4_semget(arg1, arg2, arg3);
6119 + return svr4_semop(arg1, (struct sembuf *)arg2, arg3);
6126 +ishm_to_lshm(struct ibcs2_shmid_ds *is, struct shmid_ds *ls)
6128 + ip_to_lp(&is->shm_perm, &ls->shm_perm);
6129 + ls->shm_segsz = is->shm_segsz;
6130 + ls->shm_lpid = is->shm_lpid;
6131 + ls->shm_cpid = is->shm_cpid;
6132 + ls->shm_nattch = is->shm_nattch;
6133 + ls->shm_atime = is->shm_atime;
6134 + ls->shm_dtime = is->shm_dtime;
6135 + ls->shm_ctime = is->shm_ctime;
6139 +lshm_to_ishm(struct shmid_ds *ls, struct ibcs2_shmid_ds *is)
6141 + lp_to_ip(&ls->shm_perm, &is->shm_perm);
6142 + is->shm_segsz = ls->shm_segsz;
6143 + is->shm_lpid = ls->shm_lpid;
6144 + is->shm_cpid = ls->shm_cpid;
6145 + is->shm_nattch = ls->shm_nattch;
6146 + is->shm_atime = ls->shm_atime;
6147 + is->shm_dtime = ls->shm_dtime;
6148 + is->shm_ctime = ls->shm_ctime;
6152 +ishm_to_lshm_l(struct abi4_shmid_ds *is, struct shmid_ds *ls)
6154 + ip_to_lp_l(&is->shm_perm, &ls->shm_perm);
6155 + ls->shm_segsz = is->shm_segsz;
6156 + ls->shm_lpid = is->shm_lpid;
6157 + ls->shm_cpid = is->shm_cpid;
6158 + ls->shm_nattch = is->shm_nattch;
6159 + ls->shm_atime = is->shm_atime;
6160 + ls->shm_dtime = is->shm_dtime;
6161 + ls->shm_ctime = is->shm_ctime;
6165 +lshm_to_ishm_l(struct shmid_ds *ls, struct abi4_shmid_ds *is)
6167 + memset(is, 0, sizeof(*is));
6168 + lp_to_ip_l(&ls->shm_perm, &is->shm_perm);
6169 + is->shm_segsz = ls->shm_segsz;
6170 + is->shm_lpid = ls->shm_lpid;
6171 + is->shm_cpid = ls->shm_cpid;
6172 + is->shm_nattch = ls->shm_nattch;
6173 + is->shm_atime = ls->shm_atime;
6174 + is->shm_dtime = ls->shm_dtime;
6175 + is->shm_ctime = ls->shm_ctime;
6179 +svr4_shmdt(struct pt_regs *regp)
6181 + caddr_t addr = (caddr_t)get_syscall_parameter(regp, 1);
6183 +#if defined(CONFIG_ABI_TRACE)
6184 + abi_trace(ABI_TRACE_API, "shmdt(%p)\n", addr);
6186 + return sys_shmdt(addr);
6190 +svr4_shmctl(int arg1, int cmd, char *arg3)
6192 + struct ibcs2_shmid_ds is;
6193 + struct abi4_shmid_ds is4;
6194 + struct shmid_ds ls;
6198 +#if defined(CONFIG_ABI_TRACE)
6199 + abi_trace(ABI_TRACE_API, "shmctl(%d, %x, %p)\n", arg1, cmd, arg3);
6203 + case SVR4_SHM_LOCK:
6204 + return sys_shmctl(arg1, SHM_LOCK, (struct shmid_ds *)arg3);
6205 + case SVR4_SHM_UNLOCK:
6206 + return sys_shmctl(arg1, SHM_UNLOCK, (struct shmid_ds *)arg3);
6207 + case SVR4_IPC_SET:
6208 + err = copy_from_user(&is, arg3, sizeof(is)) ? -EFAULT : 0;
6211 + ishm_to_lshm(&is, &ls);
6215 + err = sys_shmctl(arg1, IPC_SET, &ls);
6220 + lshm_to_ishm(&ls, &is);
6221 + err = copy_to_user(arg3, &is, sizeof(is)) ? -EFAULT : 0;
6223 + case SVR4_IPC_SET_L:
6224 + err = copy_from_user(&is4, arg3, sizeof(is4)) ? -EFAULT : 0;
6227 + ishm_to_lshm_l(&is4, &ls);
6231 + err = sys_shmctl(arg1, IPC_SET, &ls);
6236 + lshm_to_ishm_l(&ls, &is4);
6237 + err = copy_to_user(arg3, &is4, sizeof(is4)) ? -EFAULT : 0;
6239 + case SVR4_IPC_RMID:
6240 + case SVR4_IPC_RMID_L:
6241 + return sys_shmctl(arg1, IPC_RMID, (struct shmid_ds *)arg3);
6242 + case SVR4_IPC_STAT:
6245 + err = sys_shmctl(arg1, IPC_STAT, &ls);
6251 + lshm_to_ishm(&ls, &is);
6252 + err = copy_to_user(arg3, &is, sizeof(is)) ? -EFAULT : 0;
6254 + case SVR4_IPC_STAT_L:
6257 + err = sys_shmctl(arg1, IPC_STAT, &ls);
6262 + lshm_to_ishm_l(&ls, &is4);
6263 + err = copy_to_user((char *)arg3, &is4, sizeof(is4)) ? -EFAULT : 0;
6266 +#if defined(CONFIG_ABI_TRACE)
6267 + __abi_trace("shmctl: unsupported command %d\n", cmd);
6276 +svr4_shmsys(struct pt_regs *regp)
6278 + int arg1, arg2, arg3, cmd, err = 0;
6282 + cmd = get_syscall_parameter(regp, 0);
6283 + if (cmd == SVR4_shmdt) {
6284 + err = svr4_shmdt(regp);
6288 + arg1 = get_syscall_parameter(regp, 1);
6289 + arg2 = get_syscall_parameter(regp, 2);
6290 + arg3 = get_syscall_parameter(regp, 3);
6294 +#if defined(CONFIG_ABI_TRACE)
6295 + abi_trace(ABI_TRACE_API, "shmat(%d, %x, %o)\n", arg1, arg2, arg3);
6300 + err = do_shmat(arg1, (caddr_t)arg2, arg3, &raddr);
6305 +#if defined(CONFIG_ABI_TRACE)
6306 + abi_trace(ABI_TRACE_API, "shmat returns %x\n", err);
6310 +#if defined(CONFIG_ABI_TRACE)
6311 + abi_trace(ABI_TRACE_API, "shmget(%d, %x, %o)\n", arg1, arg2, arg3);
6313 + err = sys_shmget(arg1, arg2, arg3);
6314 +#if defined(CONFIG_ABI_TRACE)
6315 + abi_trace(ABI_TRACE_API, "shmget returns %d\n", err);
6319 + err = svr4_shmctl(arg1, arg2, (char *)arg3);
6322 +#if defined(CONFIG_ABI_TRACE)
6323 + __abi_trace("shmsys: unsupported command: %x\n", cmd);
6329 + if (err < 0 && err > -255) {
6330 + set_error(regp, iABI_errors(-err));
6331 + abi_trace(ABI_TRACE_API, "Error %d\n", get_result(regp));
6335 + clear_error(regp);
6336 + set_result(regp, err);
6341 +imsq_to_lmsq(struct ibcs2_msqid_ds * im, struct msqid_ds * lm)
6343 + ip_to_lp(&im->msg_perm, &lm->msg_perm);
6344 + lm->msg_first = im->msg_first;
6345 + lm->msg_last = im->msg_last;
6346 + lm->msg_cbytes = im->msg_cbytes;
6347 + lm->msg_qnum = im->msg_qnum;
6348 + lm->msg_qbytes = im->msg_qbytes;
6349 + lm->msg_lspid = im->msg_lspid;
6350 + lm->msg_lrpid = im->msg_lrpid;
6351 + lm->msg_stime = im->msg_stime;
6352 + lm->msg_rtime = im->msg_rtime;
6353 + lm->msg_ctime = im->msg_ctime;
6357 +lmsq_to_imsq(struct msqid_ds *lm, struct ibcs2_msqid_ds *im)
6359 + lp_to_ip(&lm->msg_perm, &im->msg_perm);
6360 + im->msg_first = lm->msg_first;
6361 + im->msg_last = lm->msg_last;
6362 + im->msg_cbytes = lm->msg_cbytes;
6363 + im->msg_qnum = lm->msg_qnum;
6364 + im->msg_qbytes = lm->msg_qbytes;
6365 + im->msg_lspid = lm->msg_lspid;
6366 + im->msg_lrpid = lm->msg_lrpid;
6367 + im->msg_stime = lm->msg_stime;
6368 + im->msg_rtime = lm->msg_rtime;
6369 + im->msg_ctime = lm->msg_ctime;
6373 +imsq_to_lmsq_l(struct abi4_msqid_ds *im, struct msqid_ds *lm)
6375 + ip_to_lp_l(&im->msg_perm, &lm->msg_perm);
6376 + lm->msg_first = im->msg_first;
6377 + lm->msg_last = im->msg_last;
6378 + lm->msg_cbytes = im->msg_cbytes;
6379 + lm->msg_qnum = im->msg_qnum;
6380 + lm->msg_qbytes = im->msg_qbytes;
6381 + lm->msg_lspid = im->msg_lspid;
6382 + lm->msg_lrpid = im->msg_lrpid;
6383 + lm->msg_stime = im->msg_stime;
6384 + lm->msg_rtime = im->msg_rtime;
6385 + lm->msg_ctime = im->msg_ctime;
6389 +lmsq_to_imsq_l(struct msqid_ds *lm, struct abi4_msqid_ds *im)
6391 + memset(im, 0, sizeof(*im));
6392 + lp_to_ip_l(&lm->msg_perm, &im->msg_perm);
6393 + im->msg_first = lm->msg_first;
6394 + im->msg_last = lm->msg_last;
6395 + im->msg_cbytes = lm->msg_cbytes;
6396 + im->msg_qnum = lm->msg_qnum;
6397 + im->msg_qbytes = lm->msg_qbytes;
6398 + im->msg_lspid = lm->msg_lspid;
6399 + im->msg_lrpid = lm->msg_lrpid;
6400 + im->msg_stime = lm->msg_stime;
6401 + im->msg_rtime = lm->msg_rtime;
6402 + im->msg_ctime = lm->msg_ctime;
6406 +svr4_msgctl(int arg1, int cmd, char *arg3)
6408 + struct ibcs2_msqid_ds im;
6409 + struct abi4_msqid_ds im4;
6410 + struct msqid_ds lm;
6415 + case SVR4_IPC_SET:
6416 + err = copy_from_user(&im, arg3, sizeof(im)) ? -EFAULT : 0;
6420 + imsq_to_lmsq(&im, &lm);
6424 + err = sys_msgctl(arg1, IPC_SET, &lm);
6427 + lmsq_to_imsq(&lm, &im);
6428 + err = copy_to_user(arg3, &im, sizeof(im)) ? -EFAULT : 0;
6430 + case SVR4_IPC_SET_L:
6431 + err = copy_from_user(&im4, arg3, sizeof(im4)) ? -EFAULT : 0;
6434 + imsq_to_lmsq_l(&im4, &lm);
6438 + err = sys_msgctl(arg1, IPC_SET, &lm);
6441 + lmsq_to_imsq_l(&lm, &im4);
6442 + err = copy_to_user(arg3, &im4, sizeof(im4)) ? -EFAULT : 0;
6444 + case SVR4_IPC_RMID:
6445 + case SVR4_IPC_RMID_L:
6446 + return sys_msgctl(arg1, IPC_RMID, (struct msqid_ds *)arg3);
6447 + case SVR4_IPC_STAT:
6450 + err = sys_msgctl(arg1, IPC_STAT, &lm);
6456 + lmsq_to_imsq(&lm, &im);
6457 + err = copy_to_user(arg3, &im, sizeof(im)) ? -EFAULT : 0;
6459 + case SVR4_IPC_STAT_L:
6462 + err = sys_msgctl(arg1, IPC_STAT, &lm);
6468 + lmsq_to_imsq_l(&lm, &im4);
6469 + err = copy_to_user(arg3, &im4, sizeof(im4)) ? -EFAULT : 0;
6472 + __abi_trace("msgctl: unsupported command: %x\n", cmd);
6480 +svr4_msgsys(struct pt_regs *regp)
6482 + int err, cmd, arg1, arg2, arg3, arg4, arg5;
6485 + * Special handling as msgrcv is ugly.
6487 + cmd = get_syscall_parameter(regp, 0);
6488 + arg1 = get_syscall_parameter(regp, 1);
6489 + arg2 = get_syscall_parameter(regp, 2);
6493 + return sys_msgget((key_t)arg1, arg2);
6495 + arg3 = get_syscall_parameter(regp, 3);
6496 + return svr4_msgctl(arg1, arg2, (caddr_t)arg3);
6498 + arg3 = get_syscall_parameter(regp, 3);
6499 + arg4 = get_syscall_parameter(regp, 4);
6500 + arg5 = get_syscall_parameter(regp, 5);
6501 + return sys_msgrcv(arg1, (struct msgbuf *)arg2, arg3, arg4, arg5);
6503 + arg3 = get_syscall_parameter(regp, 3);
6504 + arg4 = get_syscall_parameter(regp, 4);
6505 + err = sys_msgsnd(arg1, (struct msgbuf *)arg2, arg3, arg4);
6506 + return ((err > 0) ? 0 : err);
6509 + __abi_trace("msgsys: unsupported command: %x\n", cmd);
6513 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
6514 +EXPORT_SYMBOL(svr4_msgsys);
6515 +EXPORT_SYMBOL(svr4_semsys);
6516 +EXPORT_SYMBOL(svr4_shmsys);
6518 diff -Nru linux-2.6.7/abi/svr4/Makefile linux-2.6.7-abi/abi/svr4/Makefile
6519 --- linux-2.6.7/abi/svr4/Makefile 1970-01-01 01:00:00.000000000 +0100
6520 +++ linux-2.6.7-abi/abi/svr4/Makefile 2004-07-22 17:44:20.000000000 +0200
6523 +svr4-y := hrtsys.o ioctl.o ipc.o mmap.o open.o svr4.o sysconf.o \
6524 + sysfs.o sysinfo.o sysi86.o ulimit.o utsname.o stream.o \
6525 + stat.o socksys.o signal.o misc.o socket.o statvfs.o \
6528 +# emulations for all kinds of weird ioctls...
6529 +svr4-y += filio.o termios.o consio.o tapeio.o sockio.o
6532 +svr4-$(CONFIG_ABI_XTI) += timod.o xti.o
6533 +svr4-$(CONFIG_ABI_SPX) += timod.o
6535 +abi-svr4-objs += $(sort $(svr4-y))
6538 +obj-$(CONFIG_ABI_SVR4) += abi-svr4.o
6540 +abi-svr4.o: $(abi-svr4-objs)
6541 + $(LD) -r -o $@ $(abi-svr4-objs)
6542 diff -Nru linux-2.6.7/abi/svr4/misc.c linux-2.6.7-abi/abi/svr4/misc.c
6543 --- linux-2.6.7/abi/svr4/misc.c 1970-01-01 01:00:00.000000000 +0100
6544 +++ linux-2.6.7-abi/abi/svr4/misc.c 2004-07-22 17:44:20.000000000 +0200
6547 + * Copyright (C) 1993 Linus Torvalds
6548 + * Copyright (C) 2001 Caldera Deutschland GmbH
6550 + * Modified by Eric Youngdale to include all ibcs syscalls.
6551 + * Re-written by Drew Sullivan to handle lots more of the syscalls correctly.
6556 +#include <linux/module.h>
6557 +#include <linux/types.h>
6558 +#include <linux/errno.h>
6559 +#include <linux/sched.h>
6560 +#include <linux/kernel.h>
6561 +#include <linux/mm.h>
6562 +#include <linux/gfp.h>
6563 +#include <linux/stat.h>
6564 +#include <linux/stddef.h>
6565 +#include <linux/unistd.h>
6566 +#include <linux/ptrace.h>
6567 +#include <linux/fcntl.h>
6568 +#include <linux/time.h>
6569 +#include <linux/personality.h>
6570 +#include <linux/syscalls.h>
6572 +#include <linux/fs.h>
6573 +#include <linux/sys.h>
6574 +#include <linux/slab.h>
6575 +#include <linux/file.h>
6576 +#include <linux/dirent.h>
6578 +#include <asm/uaccess.h>
6579 +#include <asm/system.h>
6581 +#include <abi/signal.h>
6582 +#include <abi/util/trace.h>
6584 +#include <abi/svr4/types.h>
6587 +MODULE_DESCRIPTION("common code for SVR3/SVR4 based personalities");
6588 +MODULE_AUTHOR("Christoph Hellwig, partially taken from iBCS");
6589 +MODULE_LICENSE("GPL");
6595 + return sys_time(0);
6599 +abi_brk(unsigned long brk)
6601 + unsigned long newbrk = PAGE_ALIGN(brk), oldbrk, sysbrk;
6603 + down_read(¤t->mm->mmap_sem);
6606 + oldbrk = PAGE_ALIGN(current->mm->brk);
6607 + up_read(¤t->mm->mmap_sem);
6609 + if (newbrk != oldbrk) {
6610 + sysbrk = sys_brk(brk);
6611 + if (PAGE_ALIGN(sysbrk) != newbrk)
6617 + /* return non-pagealigned old brk value */
6618 + oldbrk = current->mm->brk;
6619 + up_read(¤t->mm->mmap_sem);
6624 + * UNIX wants a 0-edx after fork and may have set
6625 + * the carry flag before calling fork.
6628 +abi_fork(struct pt_regs *regs)
6632 + regs->eflags &= ~1;
6633 + retval = do_fork(SIGCHLD, regs->esp, regs, 0,
6634 + /* parent_tidptr */NULL, /* child_tidptr */NULL);
6640 + * Unlike Linux, UNIX does not use C calling conventions
6644 +abi_pipe(struct pt_regs *regs)
6646 + int filedes[2], retval;
6648 + retval = do_pipe(filedes);
6649 + if (retval == 0) {
6650 + retval = filedes[0];
6651 + regs->edx = filedes[1];
6657 + * Note the double value return in eax and edx.
6660 +abi_getpid(struct pt_regs *regs)
6662 + regs->edx = current->parent->pid;
6663 + return current->pid;
6667 + * Note the double value return in eax and edx.
6670 +abi_getuid(struct pt_regs *regs)
6672 + regs->edx = current->euid;
6673 + return current->uid;
6677 + * Note the double value return in eax and edx.
6680 +abi_getgid(struct pt_regs *regs)
6682 + regs->edx = current->egid;
6683 + return current->gid;
6695 +#define MAGIC_WAITPID_FLAG (FLAG_ZF | FLAG_PF | FLAG_SF | FLAG_OF)
6698 +abi_wait(struct pt_regs * regs)
6701 + long result, kopt = 0;
6706 + * Xenix wait() puts status to edx and returns pid.
6708 + * XXX xenix should get it's own syyent table so we can
6709 + * XXX rip this cruft out.
6711 + if (is_cur_personality(PER_XENIX)) {
6714 + result = sys_wait4(-1, &loc, 0, NULL);
6722 + * if ZF,PF,SF,and OF are set then it is waitpid
6724 + if ((regs->eflags & MAGIC_WAITPID_FLAG) == MAGIC_WAITPID_FLAG) {
6725 + get_user(pid, ((u_long *)regs->esp)+1);
6726 + get_user(loc, ((u_long *)regs->esp)+2);
6727 + get_user(opt, ((u_long *)regs->esp)+3);
6730 + * Now translate the options from the SVr4 numbers
6735 + kopt |= WUNTRACED;
6737 + result = sys_wait4(pid, (u_int *)loc, kopt, NULL);
6739 + get_user(loc, ((u_long *)regs->esp)+1);
6740 + result = sys_wait4(-1, (u_int *)loc, WUNTRACED, NULL);
6743 + if (result < 0 || !loc)
6746 + get_user(regs->edx, (u_long *)loc);
6747 + if ((regs->edx & 0xff) == 0x7f) {
6750 + sig = (regs->edx >> 8) & 0xff;
6751 + if (sig < NSIGNALS)
6752 + sig = current_thread_info()->exec_domain->signal_map[sig];
6753 + regs->edx = (regs->edx & (~0xff00)) | (sig << 8);
6754 + put_user(regs->edx, (u_long *)loc);
6755 + } else if (regs->edx && regs->edx == (regs->edx & 0xff)) {
6756 + if ((regs->edx & 0x7f) < NSIGNALS)
6757 + regs->edx = current_thread_info()->exec_domain->signal_map[regs->edx & 0x7f];
6758 + put_user(regs->edx, (u_long *)loc);
6763 +#if defined(CONFIG_ABI_TRACE)
6765 + * Trace arguments of exec().
6767 + * We show up to twenty arguments and enviroment variables.
6768 + * This could as well be sysctl configurable.
6771 +trace_exec(struct pt_regs *regs, char *pgm, char **argv, char **envp)
6773 + char **v, *p = NULL, *q = NULL;
6778 + __abi_trace("\tpgm: %p pointer error %ld\n", pgm, PTR_ERR(q));
6780 + __abi_trace("\tpgm: %p \"%s\"\n", pgm, q);
6784 + for (i = 0, v = argv; v && i < 20; v++, i++) {
6785 + if (get_user(p, v) || !p)
6790 + __abi_trace("\targ: %p pointer error %ld\n",
6793 + __abi_trace("\targ: %p \"%s\"\n", p, q);
6799 + __abi_trace("\targ: ...\n");
6801 + for (i = 0, v = envp; v && i < 20; v++, i++) {
6802 + if (get_user(p, v) || !p)
6807 + __abi_trace("\tenv: %p pointer error %ld\n",
6810 + __abi_trace("\tenv: %p \"%s\"\n", p, q);
6816 + __abi_trace("\tenv: ...\n");
6821 + * Execute a new program.
6823 + * The difference from the native version is that we
6824 + * optionally trace the arguments.
6827 +abi_exec(struct pt_regs *regs)
6829 + char *pgm, **argv, **envp;
6833 + get_user((u_long)pgm, ((u_long *)regs->esp)+1);
6834 + get_user((u_long)argv, ((u_long *)regs->esp)+2);
6835 + get_user((u_long)envp, ((u_long *)regs->esp)+3);
6837 +#if defined(CONFIG_ABI_TRACE)
6838 + if (abi_traced(ABI_TRACE_API))
6839 + trace_exec(regs, pgm, argv, envp);
6842 + filename = getname(pgm);
6843 + if (!IS_ERR(filename)) {
6844 + error = do_execve(filename, argv, envp, regs);
6845 + putname (filename);
6847 + error = PTR_ERR(filename);
6852 + * Yet another crufy SysV multiplexed syscall.
6853 + * This time it's all the process group and session handling.
6855 + * NOTE: we return EPERM on get_user failures as EFAULT is not
6856 + * a valid return value for theses calls.
6859 +abi_procids(struct pt_regs *regs)
6861 + int offset = 0, op;
6863 + if (get_user(op, ((u_long *)regs->esp)+1))
6866 + /* Remap op codes for current personality if necessary. */
6867 + switch (get_cur_personality_id()) {
6868 + case (PERID_SVR3):
6869 + case (PERID_SCOSVR3):
6870 + case (PERID_WYSEV386):
6871 + case (PERID_XENIX):
6873 + * SCO at least uses an interesting library to
6874 + * syscall mapping that leaves an extra return
6875 + * address between the op code and the arguments.
6877 + * WTF does SCO at least mean?
6878 + * Could someone please verify this with another
6879 + * SVR3 derivate as I have none.
6884 + if (op < 0 || op > 5)
6886 + op = "\000\001\005\003\377\377"[op];
6890 + case 0: /* getpgrp */
6891 + return process_group(current);
6893 + case 1: /* setpgrp */
6894 + sys_setpgid(0, 0);
6895 + return process_group(current);
6897 + case 2: /* getsid */
6901 + if (get_user(pid, ((u_long *)regs->esp)+2 + offset))
6903 + return sys_getsid(pid);
6906 + case 3: /* setsid */
6907 + return sys_setsid();
6909 + case 4: /* getpgid */
6913 + if (get_user(pid, ((u_long *)regs->esp)+2 + offset))
6915 + return sys_getpgid(pid);
6918 + case 5: /* setpgid */
6922 + if (get_user(pid, ((u_long *)regs->esp)+2 + offset))
6924 + if (get_user(pgid, ((u_long *)regs->esp)+3 + offset))
6926 + return sys_setpgid(pid, pgid);
6935 + * Stupid bloody thing is trying to read a directory.
6937 + * Some old programs expect this to work. It works on SCO.
6938 + * To emulate it we have to map a dirent to a direct. This
6939 + * involves shrinking a long inode to a short. Fortunately
6940 + * nothing this archaic is likely to care about anything
6941 + * but the filenames of entries with non-zero inodes.
6944 +abi_read_dir(int fd, char *buf, int count)
6947 + struct old_linux_dirent *de;
6950 + int posn = 0, reclen = 0;
6958 + de = (struct old_linux_dirent *)__get_free_page(GFP_KERNEL);
6963 + while (posn + reclen < count) {
6967 + * Save the current position and get another dirent
6972 + set_fs (get_ds());
6973 + error = old_readdir(fd, de, 1);
6980 + * If it'll fit in the buffer save it.
6981 + * Otherwise back up so it is read next time around.
6982 + * Oh, if we're at the beginning of the buffer there's
6983 + * no chance that this entry will ever fit so don't
6984 + * copy it and don't back off - we'll just pretend it
6989 + * SCO (at least) handles long filenames by breaking
6990 + * them up in to 14 character chunks of which all
6991 + * but the last have the inode set to 0xffff.
6992 + * Those chunks will get aligned to a 4 byte boundary
6993 + * thus leaving two bytes in each entry for other purposes.
6995 + * Well, that's SCO E(A)FS.
6996 + * HTFS and DTFS should handle it better.
6999 + reclen = 16 * ((de->d_namlen + 13) / 14);
7000 + if (posn + reclen > count) {
7002 + sys_lseek(fd, here, 0);
7009 + * Put all but the last chunk.
7011 + while (de->d_namlen > 14) {
7012 + put_user(0xffff, (u_short *)(buf+posn));
7014 + if (copy_to_user(buf+posn, p, 14))
7018 + de->d_namlen -= 14;
7022 + * Put the last chunk. Note the we have to fold a
7023 + * long inode number down to a short avoiding
7024 + * giving a zero inode number since that indicates
7025 + * an unused directory slot. Note also that the
7026 + * folding used here must match that used in stat()
7027 + * or path finding programs that do read() on
7028 + * directories will fail.
7032 + * This appears to match what SCO does for
7033 + * reads on a directory with long inodes.
7035 + if ((u_long)de->d_ino > 0xfffe) {
7036 + if (put_user(0xfffe, buf+posn))
7039 + if (put_user((short)de->d_ino, buf+posn))
7044 + * This attempts to match the way stat and
7045 + * getdents fold long inodes to shorts.
7047 + if ((u_long)de->d_ino & 0xffff ) {
7048 + if (put_user((u_long)de->d_ino & 0xffff, buf+posn))
7051 + if (put_user(0xfffe, buf+posn))
7056 + if (copy_to_user(buf+posn, p, de->d_namlen))
7060 + * Ensure that filenames that don't fill the array
7061 + * completely are null filled.
7063 + for (; de->d_namlen < 14; de->d_namlen++) {
7064 + if (put_user('\0', buf+posn+de->d_namlen))
7070 + free_page((u_long)de);
7074 + * If we've put something in the buffer return the byte count
7075 + * otherwise return the error status.
7077 + return (posn ? posn : error);
7081 + free_page((u_long)de);
7088 + * We could use Linux read if there wouldn't be the
7089 + * read on directory issue..
7092 +abi_read(int fd, char *buf, int count)
7096 + error = sys_read(fd, buf, count);
7097 + if (error == -EISDIR)
7098 + error = abi_read_dir(fd, buf, count);
7103 + * Linux doesn't allow trailing slashes in mkdir.
7104 + * Old UNIX apps expect it work anyway, so we have
7105 + * to get rid of them here.
7108 +abi_mkdir(const char *fname, int mode)
7114 + tmp = getname(fname);
7116 + return PTR_ERR(tmp);
7118 + for (p = tmp; *p; p++);
7125 + error = sys_mkdir(tmp, mode);
7133 + * Unlike UNIX Linux doesn't allow to create
7134 + * directories using mknod.
7137 +svr4_mknod(char *filename, svr4_o_mode_t mode, svr4_o_dev_t dev)
7139 + if ((mode & 0017000) == 0040000)
7140 + return abi_mkdir(filename, mode);
7141 + return sys_mknod(filename, mode, dev);
7145 +svr4_do_xmknod(char *filename, svr4_mode_t mode, svr4_dev_t dev)
7147 + u_int minor = (dev & 0x3ffff), major = (dev >> 18);
7149 + if (minor > 0xff || major > 0xff)
7151 + return svr4_mknod(filename, mode, ((major << 8) | minor));
7155 +enum {SVR4_mknod = 1, SVR4_xmknod = 2};
7158 +svr4_xmknod(int vers, char *filename, svr4_mode_t mode, svr4_dev_t dev)
7162 + return svr4_mknod(filename, mode, dev);
7164 + return svr4_do_xmknod(filename, mode, dev);
7167 +#if defined(CONFIG_ABI_TRACE)
7168 + abi_trace(ABI_TRACE_API, "xmknod version %d not supported\n", vers);
7174 +abi_kill(int pid, int sig)
7176 + int insig, outsig;
7178 + insig = (sig & 0xff);
7179 + outsig = current_thread_info()->exec_domain->signal_map[insig];
7181 +#if defined(CONFIG_ABI_TRACE)
7182 + abi_trace(ABI_TRACE_SIGNAL, "kill: %d -> %d\n", insig, outsig);
7185 + return sys_kill(pid, outsig);
7188 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
7189 +EXPORT_SYMBOL(abi_brk);
7190 +EXPORT_SYMBOL(abi_exec);
7191 +EXPORT_SYMBOL(abi_fork);
7192 +EXPORT_SYMBOL(abi_getgid);
7193 +EXPORT_SYMBOL(abi_getpid);
7194 +EXPORT_SYMBOL(abi_getuid);
7195 +EXPORT_SYMBOL(abi_kill);
7196 +EXPORT_SYMBOL(abi_mkdir);
7197 +EXPORT_SYMBOL(abi_pipe);
7198 +EXPORT_SYMBOL(abi_procids);
7199 +EXPORT_SYMBOL(abi_read);
7200 +EXPORT_SYMBOL(abi_time);
7201 +EXPORT_SYMBOL(abi_wait);
7202 +EXPORT_SYMBOL(svr4_mknod);
7203 +EXPORT_SYMBOL(svr4_xmknod);
7205 diff -Nru linux-2.6.7/abi/svr4/mmap.c linux-2.6.7-abi/abi/svr4/mmap.c
7206 --- linux-2.6.7/abi/svr4/mmap.c 1970-01-01 01:00:00.000000000 +0100
7207 +++ linux-2.6.7-abi/abi/svr4/mmap.c 2004-07-22 17:44:20.000000000 +0200
7210 + * Copyright (c) 2001 Christoph Hellwig.
7211 + * All rights reserved.
7213 + * This program is free software; you can redistribute it and/or modify
7214 + * it under the terms of the GNU General Public License as published by
7215 + * the Free Software Foundation; either version 2 of the License, or
7216 + * (at your option) any later version.
7218 + * This program is distributed in the hope that it will be useful,
7219 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
7220 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7221 + * GNU General Public License for more details.
7223 + * You should have received a copy of the GNU General Public License
7224 + * along with this program; if not, write to the Free Software
7225 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
7231 + * Support for mmap on SVR4 and derivates.
7233 +#include <linux/mm.h>
7234 +#include <linux/errno.h>
7235 +#include <linux/file.h>
7236 +#include <linux/mman.h>
7237 +#include <linux/module.h>
7239 +#include <asm/uaccess.h>
7241 +#include <abi/svr4/mman.h>
7242 +#include <abi/svr4/types.h>
7244 +#include <abi/util/trace.h>
7248 +svr4_mmap(u_long addr, size_t len, int prot, int flags, int fd, svr4_off_t off)
7250 + struct file *file = NULL;
7253 + if (flags & SVR4_MAP_UNIMPL) {
7254 +#if defined(CONFIG_ABI_TRACE)
7255 + abi_trace(ABI_TRACE_UNIMPL,
7256 + "unsupported mmap flags: 0x%x\n", flags & SVR4_MAP_UNIMPL);
7258 + flags &= ~SVR4_MAP_UNIMPL;
7261 + if (!(flags & SVR4_MAP_ANONYMOUS)) {
7266 + flags &= ~SVR4_MAP_ANONYMOUS;
7267 + flags |= MAP_ANONYMOUS;
7270 + down_write(¤t->mm->mmap_sem);
7271 + mapaddr = do_mmap(file, addr, len, prot, flags, off);
7272 + up_write(¤t->mm->mmap_sem);
7281 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
7282 +EXPORT_SYMBOL(svr4_mmap);
7284 diff -Nru linux-2.6.7/abi/svr4/open.c linux-2.6.7-abi/abi/svr4/open.c
7285 --- linux-2.6.7/abi/svr4/open.c 1970-01-01 01:00:00.000000000 +0100
7286 +++ linux-2.6.7-abi/abi/svr4/open.c 2004-07-22 17:44:20.000000000 +0200
7289 + * Copyright (c) 1993 Joe Portman (baron@hebron.connected.com)
7290 + * Copyright (c) 1993, 1994 Drew Sullivan (re-worked for iBCS2)
7291 + * Copyright (c) 2000 Christoph Hellwig (rewrote lookup-related code)
7296 +#include <linux/config.h>
7297 +#include <linux/module.h>
7299 +#include <linux/vfs.h>
7300 +#include <linux/types.h>
7301 +#include <linux/utime.h>
7302 +#include <linux/errno.h>
7303 +#include <linux/fcntl.h>
7304 +#include <linux/stat.h>
7305 +#include <linux/string.h>
7306 +#include <linux/sched.h>
7307 +#include <linux/kernel.h>
7308 +#include <linux/signal.h>
7309 +#include <linux/tty.h>
7310 +#include <linux/time.h>
7311 +#include <linux/slab.h>
7312 +#include <linux/socket.h>
7313 +#include <linux/net.h>
7314 +#include <linux/un.h>
7315 +#include <linux/file.h>
7316 +#include <linux/dirent.h>
7317 +#include <linux/personality.h>
7318 +#include <linux/syscalls.h>
7319 +#include <linux/namei.h>
7321 +#include <asm/uaccess.h>
7322 +#include <asm/bitops.h>
7324 +#include <asm/abi_machdep.h>
7325 +#include <abi/svr4/statfs.h>
7326 +#include <abi/svr4/sysent.h>
7328 +#include <abi/util/trace.h>
7329 +#include <abi/util/map.h>
7333 +copy_kstatfs(struct svr4_statfs *buf, struct kstatfs *st)
7335 + struct svr4_statfs ibcsstat;
7337 + ibcsstat.f_type = st->f_type;
7338 + ibcsstat.f_bsize = st->f_bsize;
7339 + ibcsstat.f_frsize = 0;
7340 + ibcsstat.f_blocks = st->f_blocks;
7341 + ibcsstat.f_bfree = st->f_bfree;
7342 + ibcsstat.f_files = st->f_files;
7343 + ibcsstat.f_ffree = st->f_ffree;
7344 + memset(ibcsstat.f_fname, 0, sizeof(ibcsstat.f_fname));
7345 + memset(ibcsstat.f_fpack, 0, sizeof(ibcsstat.f_fpack));
7347 + /* Finally, copy it to the user's buffer */
7348 + return copy_to_user(buf, &ibcsstat, sizeof(struct svr4_statfs));
7351 +int svr4_statfs(const char * path, struct svr4_statfs * buf, int len, int fstype)
7353 + struct svr4_statfs ibcsstat;
7355 + if (len > (int)sizeof(struct svr4_statfs))
7359 + struct nameidata nd;
7362 + error = user_path_walk(path, &nd);
7364 + struct kstatfs tmp;
7366 + error = vfs_statfs(nd.dentry->d_inode->i_sb, &tmp);
7367 + if (!error && copy_kstatfs(buf, &tmp))
7369 + path_release(&nd);
7376 + * Linux can't stat unmounted filesystems so we
7377 + * simply lie and claim 500MB of 8GB is free. Sorry.
7379 + ibcsstat.f_bsize = 1024;
7380 + ibcsstat.f_frsize = 0;
7381 + ibcsstat.f_blocks = 8 * 1024 * 1024; /* 8GB */
7382 + ibcsstat.f_bfree = 500 * 1024; /* 100MB */
7383 + ibcsstat.f_files = 60000;
7384 + ibcsstat.f_ffree = 50000;
7385 + memset(ibcsstat.f_fname, 0, sizeof(ibcsstat.f_fname));
7386 + memset(ibcsstat.f_fpack, 0, sizeof(ibcsstat.f_fpack));
7388 + /* Finally, copy it to the user's buffer */
7389 + return copy_to_user(buf, &ibcsstat, len) ? -EFAULT : 0;
7392 +int svr4_fstatfs(unsigned int fd, struct svr4_statfs * buf, int len, int fstype)
7394 + struct svr4_statfs ibcsstat;
7396 + if (len > (int)sizeof(struct svr4_statfs))
7400 + struct file * file;
7401 + struct kstatfs tmp;
7408 + error = vfs_statfs(file->f_dentry->d_inode->i_sb, &tmp);
7409 + if (!error && copy_kstatfs(buf, &tmp))
7418 + * Linux can't stat unmounted filesystems so we
7419 + * simply lie and claim 500MB of 8GB is free. Sorry.
7421 + ibcsstat.f_bsize = 1024;
7422 + ibcsstat.f_frsize = 0;
7423 + ibcsstat.f_blocks = 8 * 1024 * 1024; /* 8GB */
7424 + ibcsstat.f_bfree = 500 * 1024; /* 100MB */
7425 + ibcsstat.f_files = 60000;
7426 + ibcsstat.f_ffree = 50000;
7427 + memset(ibcsstat.f_fname, 0, sizeof(ibcsstat.f_fname));
7428 + memset(ibcsstat.f_fpack, 0, sizeof(ibcsstat.f_fpack));
7430 + /* Finally, copy it to the user's buffer */
7431 + return copy_to_user(buf, &ibcsstat, len) ? -EFAULT : 0;
7434 +int svr4_open(const char *fname, int flag, int mode)
7437 + return sys_open(fname, map_flags(flag, fl_svr4_to_linux), mode);
7441 + struct file *file;
7442 + mm_segment_t old_fs;
7444 + struct sockaddr_un addr;
7446 + fd = sys_open(fname, map_flags(flag, fl_svr4_to_linux), mode);
7450 + /* Sometimes a program may open a pathname which it expects
7451 + * to be a named pipe (or STREAMS named pipe) when the
7452 + * Linux domain equivalent is a Unix domain socket. (e.g.
7453 + * UnixWare uses a STREAMS named pipe /dev/X/Nserver.0 for
7454 + * X :0 but Linux uses a Unix domain socket /tmp/.X11-unix/X0)
7455 + * It isn't enough just to make the symlink because you cannot
7456 + * open() a socket and read/write it. If we spot the error we can
7457 + * switch to socket(), connect() and things will likely work
7458 + * as expected however.
7462 + return fd; /* Huh?!? */
7463 + if (!S_ISSOCK(file->f_dentry->d_inode->i_mode)) {
7470 + args[0] = AF_UNIX;
7471 + args[1] = SOCK_STREAM;
7473 + old_fs = get_fs();
7475 + fd = sys_socketcall(SYS_SOCKET, args);
7480 + p = getname(fname);
7483 + return PTR_ERR(p);
7485 + if (strlen(p) >= UNIX_PATH_MAX) {
7490 + addr.sun_family = AF_UNIX;
7491 + strcpy(addr.sun_path, p);
7495 + args[1] = (int)&addr;
7496 + args[2] = sizeof(struct sockaddr_un);
7498 + error = sys_socketcall(SYS_CONNECT, args);
7509 +#define NAME_OFFSET(de) ((int) ((de)->d_name - (char *) (de)))
7510 +#define ROUND_UP(x) (((x)+sizeof(long)-1) & ~(sizeof(long)-1))
7512 +struct svr4_getdents_callback {
7513 + struct dirent * current_dir;
7514 + struct dirent * previous;
7519 +static int svr4_filldir(void * __buf, const char * name, int namlen,
7520 + loff_t offset, ino_t ino, unsigned int d_type)
7522 + struct dirent * dirent;
7523 + struct svr4_getdents_callback * buf = (struct svr4_getdents_callback *) __buf;
7524 + int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1);
7526 + buf->error = -EINVAL; /* only used if we fail.. */
7527 + if (reclen > buf->count)
7530 + dirent = buf->previous;
7532 + put_user(offset, &dirent->d_off);
7533 + dirent = buf->current_dir;
7534 + buf->previous = dirent;
7536 + if (is_cur_personality_flag(PERF_SHORT_INODE)) {
7537 + /* read() on a directory only handles
7538 + * short inodes but cannot use 0 as that
7539 + * indicates an empty directory slot.
7540 + * Therefore stat() must also fold
7541 + * inode numbers avoiding 0. Which in
7542 + * turn means that getdents() must fold
7543 + * inodes avoiding 0 - if the program
7544 + * was built in a short inode environment.
7545 + * If we have short inodes in the dirent
7546 + * we also have a two byte pad so we
7547 + * can let the high word fall in the pad.
7548 + * This makes it a little more robust if
7549 + * we guessed the inode size wrong.
7551 + if (!((unsigned long)dirent->d_ino & 0xffff))
7552 + dirent->d_ino = 0xfffffffe;
7555 + put_user(ino, &dirent->d_ino);
7556 + put_user(reclen, &dirent->d_reclen);
7557 + copy_to_user(dirent->d_name, name, namlen);
7558 + put_user(0, dirent->d_name + namlen);
7559 + ((char *) dirent) += reclen;
7560 + buf->current_dir = dirent;
7561 + buf->count -= reclen;
7567 +int svr4_getdents(int fd, char *dirent, int count)
7569 + struct file * file;
7570 + struct dirent * lastdirent;
7571 + struct svr4_getdents_callback buf;
7579 + buf.current_dir = (struct dirent *) dirent;
7580 + buf.previous = NULL;
7581 + buf.count = count;
7583 + error = vfs_readdir(file, svr4_filldir, &buf);
7586 + error = buf.error;
7587 + lastdirent = buf.previous;
7589 + put_user(file->f_pos, &lastdirent->d_off);
7590 + error = count - buf.count;
7600 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
7601 +EXPORT_SYMBOL(svr4_fstatfs);
7602 +EXPORT_SYMBOL(svr4_getdents);
7603 +EXPORT_SYMBOL(svr4_open);
7604 +EXPORT_SYMBOL(svr4_statfs);
7606 diff -Nru linux-2.6.7/abi/svr4/signal.c linux-2.6.7-abi/abi/svr4/signal.c
7607 --- linux-2.6.7/abi/svr4/signal.c 1970-01-01 01:00:00.000000000 +0100
7608 +++ linux-2.6.7-abi/abi/svr4/signal.c 2004-07-22 17:44:20.000000000 +0200
7611 + * signal.c - signal emulation code
7613 + * This module does not go through the normal processing routines for
7614 + * ibcs. The reason for this is that for most events, the return is a
7615 + * procedure address for the previous setting. This procedure address
7616 + * may be negative which is not an error. Therefore, the return processing
7617 + * for standard functions is skipped by declaring this routine as a "special"
7618 + * module for the decoder and dealing with the register settings directly.
7620 + * Please consider this closely if you plan on changing this mode.
7626 +#include <linux/module.h>
7627 +#include <linux/errno.h>
7628 +#include <linux/sched.h>
7629 +#include <linux/kernel.h>
7630 +#include <linux/mm.h>
7631 +#include <linux/stddef.h>
7632 +#define __KERNEL_SYSCALLS__
7633 +#include <linux/unistd.h>
7634 +#include <linux/ptrace.h>
7635 +#include <linux/fcntl.h>
7636 +#include <linux/personality.h>
7637 +#include <linux/fs.h>
7638 +#include <linux/sys.h>
7639 +#include <linux/signal.h>
7640 +#include <linux/syscalls.h>
7642 +#include <asm/system.h>
7643 +#include <asm/uaccess.h>
7645 +#include <abi/util/map.h>
7646 +#include <abi/util/errno.h>
7647 +#include <abi/util/trace.h>
7650 +#define SIG_HOLD ((__sighandler_t)2) /* hold signal */
7652 +#include <abi/signal.h>
7653 +#include <abi/svr4/sigaction.h>
7655 +typedef void (*pfn) (void); /* Completion function */
7658 + * Parameters to the signal functions have a common stack frame. This
7659 + * defines the stack frame.
7661 +#define SIGNAL_NUMBER(regp) get_syscall_parameter((regp), 0)
7662 +#define HIDDEN_PARAM(regp) (SIGNAL_NUMBER((regp)) & ~0xFF)
7663 +#define SECOND_PARAM(regp) get_syscall_parameter((regp), 1)
7664 +#define THIRD_PARAM(regp) ((u_long)(regp)->edx)
7666 +/* Return a mask that includes SIG only. */
7667 +#define __sigmask(sig) (1 << ((sig) - 1))
7668 +#define _S(nr) (1 << ((nr) - 1))
7669 +#define _BLOCKABLE (~(_S(IBCS_SIGKILL) | _S(IBCS_SIGSTOP)))
7673 +deactivate_signal(struct task_struct *task, int signum)
7675 + spin_lock_irq(&task->sighand->siglock);
7676 + sigdelset(&task->pending.signal, signum);
7677 + recalc_sigpending();
7678 + spin_unlock_irq(&task->sighand->siglock);
7682 + * Translate the signal number to the corresponding item for Linux.
7684 +static __inline int
7685 +abi_mapsig(int sig)
7687 + if ((u_int)sig >= NSIGNALS)
7689 + return (current_thread_info()->exec_domain->signal_map[sig]);
7693 + * Either we want this static or in a header...
7696 +abi_signo(struct pt_regs *regp, int *sigp)
7700 + value = abi_mapsig(SIGNAL_NUMBER(regp) & 0xFF);
7701 + if (value == -1) {
7702 + set_error(regp, iABI_errors(EINVAL));
7711 + * Process the signal() function from iBCS
7713 + * This version appeared in "Advanced Programming in the Unix Environment"
7714 + * by W. Richard Stevens, page 298.
7717 +abi_sig_handler(struct pt_regs *regp, int sig,
7718 + __sighandler_t handler, int oneshot)
7720 + struct sigaction act, oact;
7724 + sigemptyset(&act.sa_mask);
7725 + act.sa_restorer = NULL;
7726 + act.sa_handler = handler;
7730 + act.sa_flags |= SA_ONESHOT | SA_NOMASK;
7734 + error = sys_rt_sigaction(sig, &act, &oact, sizeof(sigset_t));
7738 + set_error(regp, iABI_errors(-error));
7740 + set_result(regp, (int)oact.sa_handler);
7745 + * Process the signal() function from iBCS
7748 +abi_signal(struct pt_regs *regp)
7750 + __sighandler_t vec;
7753 + if (abi_signo(regp, &sig)) {
7754 + vec = (__sighandler_t)SECOND_PARAM(regp);
7755 + abi_sig_handler(regp, sig, vec, 1);
7762 + * Process the SVR4 sigset function.
7764 + * This is basically the same as the signal() routine with the
7765 + * exception that it will accept a SIG_HOLD parameter.
7767 + * A SIG_HOLD will defer the processing of the signal until a sigrelse()
7768 + * function is called or the signal handler is set again using this function.
7771 +abi_sigset(struct pt_regs *regp)
7774 + sigset_t newmask, oldmask;
7775 + __sighandler_t vec;
7780 + if (abi_signo(regp, &sig) == 0)
7783 + vec = (__sighandler_t)SECOND_PARAM(regp);
7784 + action = SIG_BLOCK;
7786 + if (vec != SIG_HOLD) {
7787 + action = SIG_UNBLOCK;
7788 + deactivate_signal(current, sig);
7789 + abi_sig_handler(regp, sig, vec, 0);
7793 + * Process the signal hold/unhold function.
7795 + sigemptyset(&newmask);
7796 + sigaddset(&newmask, sig);
7800 + error = sys_rt_sigprocmask(action, &newmask, &oldmask,
7801 + sizeof(sigset_t));
7805 + set_error(regp, iABI_errors(-error));
7811 + * Process the iBCS sighold function.
7813 + * Suspend the signal from future recognition.
7816 +abi_sighold(struct pt_regs *regp)
7818 + sigset_t newmask, oldmask;
7822 + if (!abi_signo(regp, &sig))
7825 + sigemptyset(&newmask);
7826 + sigaddset(&newmask, sig);
7830 + error = sys_rt_sigprocmask(SIG_BLOCK, &newmask,
7831 + &oldmask, sizeof(sigset_t));
7835 + set_error(regp, iABI_errors(-error));
7839 + * Process the iBCS sigrelse.
7841 + * Re-enable the signal processing from a previously suspended
7842 + * signal. This may have been done by calling the sighold() function
7843 + * or a longjmp() during the signal processing routine. If you do a
7844 + * longjmp() function then it is expected that you will call sigrelse
7845 + * or set the handler again using sigset before going on with the program.
7848 +abi_sigrelse(struct pt_regs *regp)
7850 + sigset_t newmask, oldmask;
7854 + if (!abi_signo(regp, &sig))
7857 + sigemptyset(&newmask);
7858 + sigaddset(&newmask, sig);
7862 + error = sys_rt_sigprocmask(SIG_UNBLOCK, &newmask,
7863 + &oldmask, sizeof(sigset_t));
7867 + set_error(regp, iABI_errors(-error));
7871 + * Process the iBCS sigignore
7873 + * This is basically a signal (...,SIG_IGN) call.
7876 +abi_sigignore(struct pt_regs *regp)
7878 + struct sigaction act, oact;
7882 + if (!abi_signo(regp, &sig))
7885 + sigemptyset(&act.sa_mask);
7887 + act.sa_restorer = NULL;
7888 + act.sa_handler = SIG_IGN;
7893 + error = sys_rt_sigaction(sig, &act, &oact, sizeof(sigset_t));
7897 + set_error(regp, iABI_errors(-error));
7901 + * Process the iBCS sigpause
7903 + * Wait for the signal indicated to arrive before resuming the
7904 + * processing. I do not know if the signal is processed first using
7905 + * the normal event processing before the return. If someone can
7906 + * shed some light on this then please correct this code. I block
7907 + * the signal and look for it to show up in the pending list.
7910 +abi_sigpause(struct pt_regs *regs)
7912 + old_sigset_t newset;
7915 + if (!abi_signo(regs, &sig))
7917 + newset = (~0UL) & (1UL << (sig-1));
7919 + if ((error = sys_sigsuspend(0, current->blocked.sig[0], newset) < 0))
7920 + set_error(regs, iABI_errors(-error));
7924 + * This is the service routine for the syscall #48 (signal funcs).
7926 + * Examine the request code and branch on the request to the appropriate
7930 +abi_sigfunc(struct pt_regs *regp)
7932 + int sig_type = (int)HIDDEN_PARAM(regp);
7934 +#if defined(CONFIG_ABI_TRACE)
7935 + abi_trace(ABI_TRACE_SIGNAL|ABI_TRACE_SIGNAL_F,
7936 + "sig%s(%ld, 0x%08lx, 0x%08lx)\n",
7937 + sig_type == 0 ? "nal"
7938 + : (sig_type == 0x100 ? "set"
7939 + : (sig_type == 0x200 ? "hold"
7940 + : (sig_type == 0x400 ? "relse"
7941 + : (sig_type == 0x800 ? "ignore"
7942 + : (sig_type == 0x1000 ? "pause"
7944 + SIGNAL_NUMBER(regp) & 0xff,
7945 + SECOND_PARAM(regp),
7946 + THIRD_PARAM(regp));
7949 + regp->eflags &= ~1;
7952 + switch (sig_type) {
7960 + abi_sighold(regp);
7963 + abi_sigrelse(regp);
7966 + abi_sigignore(regp);
7969 + abi_sigpause(regp);
7972 + set_error(regp, EINVAL);
7974 +#if defined(CONFIG_ABI_TRACE)
7975 + abi_trace(ABI_TRACE_SIGNAL|ABI_TRACE_SIGNAL_F,
7976 + "sigfunc(%x, %ld, %lx, %lx) unsupported\n",
7977 + sig_type, SIGNAL_NUMBER(regp),
7978 + SECOND_PARAM(regp), THIRD_PARAM(regp));
7983 +#if defined(CONFIG_ABI_TRACE)
7984 + abi_trace(ABI_TRACE_SIGNAL|ABI_TRACE_SIGNAL_F,
7985 + "returns %d\n", get_result(regp));
7991 + * This function is used to handle the sigaction call from SVr4 binaries.
7993 + * If anyone else uses this, this function needs to be modified since the
7994 + * order and size of the ibcs_sigaction structure is different in ibcs
7995 + * and the SVr4 ABI
7998 +abi_sigaction(int abi_signum, const struct abi_sigaction *action,
7999 + struct abi_sigaction *oldaction)
8001 + struct abi_sigaction new_sa, old_sa;
8002 + struct sigaction nsa, osa;
8006 + signo = abi_mapsig(abi_signum);
8011 + error = verify_area(VERIFY_WRITE, oldaction,
8012 + sizeof(struct abi_sigaction));
8018 + error = copy_from_user(&new_sa, action,
8019 + sizeof(struct abi_sigaction));
8022 + nsa.sa_restorer = NULL;
8023 + nsa.sa_handler = new_sa.sa_handler;
8024 + nsa.sa_mask = map_sigvec_to_kernel(new_sa.sa_mask,
8025 + current_thread_info()->exec_domain->signal_map);
8026 + if (new_sa.sa_flags & ABI_SA_ONSTACK)
8027 + nsa.sa_flags |= SA_ONSTACK;
8028 + if (new_sa.sa_flags & ABI_SA_RESTART)
8029 + nsa.sa_flags |= SA_RESTART;
8030 + if (new_sa.sa_flags & ABI_SA_NODEFER)
8031 + nsa.sa_flags |= SA_NODEFER;
8032 + if (new_sa.sa_flags & ABI_SA_RESETHAND)
8033 + nsa.sa_flags |= SA_RESETHAND;
8034 + if (new_sa.sa_flags & ABI_SA_NOCLDSTOP)
8035 + nsa.sa_flags |= SA_NOCLDSTOP;
8036 + if (new_sa.sa_flags & ABI_SA_NOCLDWAIT)
8037 + nsa.sa_flags |= SA_NOCLDWAIT;
8042 + error = sys_rt_sigaction(signo, action ? &nsa : NULL,
8043 + oldaction ? &osa : NULL, sizeof(sigset_t));
8046 + if (error || !oldaction)
8049 + old_sa.sa_handler = osa.sa_handler;
8050 + old_sa.sa_mask = map_sigvec_from_kernel(osa.sa_mask,
8051 + current_thread_info()->exec_domain->signal_invmap);
8052 + old_sa.sa_flags = 0;
8053 + if (osa.sa_flags & SA_ONSTACK)
8054 + old_sa.sa_flags |= ABI_SA_ONSTACK;
8055 + if (osa.sa_flags & SA_RESTART)
8056 + old_sa.sa_flags |= ABI_SA_RESTART;
8057 + if (osa.sa_flags & SA_NODEFER)
8058 + old_sa.sa_flags |= ABI_SA_NODEFER;
8059 + if (osa.sa_flags & SA_RESETHAND)
8060 + old_sa.sa_flags |= ABI_SA_RESETHAND;
8061 + if (osa.sa_flags & SA_NOCLDSTOP)
8062 + old_sa.sa_flags |= ABI_SA_NOCLDSTOP;
8063 + if (osa.sa_flags & SA_NOCLDWAIT)
8064 + old_sa.sa_flags |= ABI_SA_NOCLDWAIT;
8066 + * We already did the verify_area at the beginning.
8068 + __copy_to_user(oldaction, &old_sa, sizeof(struct abi_sigaction));
8073 +static short int howcnv[] = {SIG_SETMASK, SIG_BLOCK, SIG_UNBLOCK, SIG_SETMASK};
8076 +abi_sigprocmask(int how, u_long *abinset, u_long *abioset)
8078 + sigset_t new_set, *nset = NULL;
8079 + sigset_t old_set, *oset = NULL;
8080 + u_long new_set_abi, old_set_abi;
8085 + get_user(new_set_abi, abinset);
8086 + new_set = map_sigvec_to_kernel(new_set_abi,
8087 + current_thread_info()->exec_domain->signal_map);
8096 + error = sys_rt_sigprocmask(howcnv[how], nset, oset, sizeof(sigset_t));
8099 + if (!error && abioset) {
8100 + old_set_abi = map_sigvec_from_kernel(old_set,
8101 + current_thread_info()->exec_domain->signal_invmap);
8102 + put_user(old_set_abi, abioset);
8109 +abi_sigsuspend(struct pt_regs *regs)
8111 + u_long abi_mask, *abi_maskp;
8112 + old_sigset_t mask;
8114 + abi_maskp = (u_long *)SIGNAL_NUMBER(regs);
8115 + if (get_user(abi_mask, abi_maskp))
8118 + mask = map_bitvec(abi_mask, current_thread_info()->exec_domain->signal_map);
8119 +#if defined(CONFIG_ABI_TRACE)
8120 + abi_trace(ABI_TRACE_SIGNAL,
8121 + "sigsuspend(mask = %lx)\n", mask);
8123 + return sys_sigsuspend(0, current->blocked.sig[0], mask);
8126 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
8127 +EXPORT_SYMBOL(abi_sigaction);
8128 +EXPORT_SYMBOL(abi_sigfunc);
8129 +EXPORT_SYMBOL(abi_sigprocmask);
8130 +EXPORT_SYMBOL(abi_sigsuspend);
8131 +EXPORT_SYMBOL(deactivate_signal);
8133 diff -Nru linux-2.6.7/abi/svr4/socket.c linux-2.6.7-abi/abi/svr4/socket.c
8134 --- linux-2.6.7/abi/svr4/socket.c 1970-01-01 01:00:00.000000000 +0100
8135 +++ linux-2.6.7-abi/abi/svr4/socket.c 2004-07-22 17:44:20.000000000 +0200
8138 + * Copyright (c) 1994,1996 Mike Jagdis (jaggy@purplet.demon.co.uk)
8143 +#include <linux/module.h>
8144 +#include <linux/fs.h>
8145 +#include <linux/mm.h>
8146 +#include <linux/net.h>
8147 +#include <linux/personality.h>
8148 +#include <linux/ptrace.h>
8149 +#include <linux/socket.h>
8150 +#include <linux/syscalls.h>
8151 +#include <linux/types.h>
8152 +#include <asm/uaccess.h>
8153 +#include <asm/ioctls.h>
8155 +#include <abi/util/map.h>
8156 +#include <abi/util/trace.h>
8157 +#include <abi/util/socket.h>
8161 +abi_do_setsockopt(unsigned long *sp)
8164 + int level, optname;
8166 + error = verify_area(VERIFY_READ,
8167 + ((unsigned long *)sp),
8172 + get_user(level, ((unsigned long *)sp)+1);
8173 + get_user(optname, ((unsigned long *)sp)+2);
8175 +#if defined(CONFIG_ABI_TRACE)
8176 + if (abi_traced(ABI_TRACE_STREAMS|ABI_TRACE_SOCKSYS)) {
8177 + u_long optval, optlen;
8179 + get_user(optval, ((u_long *)sp) + 3);
8180 + get_user(optlen, ((u_long *)sp) + 4);
8181 + __abi_trace("setsockopt level=%d, optname=%d, "
8182 + "optval=0x%08lx, optlen=0x%08lx\n",
8183 + level, optname, optval, optlen);
8188 + case 0: /* IPPROTO_IP aka SOL_IP */
8189 + /* This is correct for the SCO family. Hopefully
8190 + * it is correct for other SYSV...
8195 + if (optname > 4) {
8197 + if (optname <= 33)
8199 + if (optname < 32 || optname > 36)
8202 + put_user(optname, ((unsigned long *)sp)+2);
8206 + put_user(SOL_SOCKET, ((unsigned long *)sp)+1);
8207 + optname = map_value(current_thread_info()->exec_domain->sockopt_map, optname, 0);
8208 + put_user(optname, ((unsigned long *)sp)+2);
8210 + switch (optname) {
8212 + unsigned long optlen;
8214 + /* SO_LINGER takes a struct linger
8215 + * as the argument but some code
8216 + * uses an int and expects to get
8217 + * away without an error. Sigh...
8219 + get_user(optlen, ((unsigned long *)sp)+4);
8220 + if (optlen == sizeof(int))
8225 + /* The following are not currently implemented
8226 + * under Linux so we must fake them in
8227 + * reasonable ways. (Only SO_PROTOTYPE is
8228 + * documented in SCO's man page).
8230 + case SO_PROTOTYPE:
8234 + return -ENOPROTOOPT;
8236 + case SO_USELOOPBACK:
8241 + /* The following are not currenty implemented
8242 + * under Linux and probably aren't settable
8245 + case SO_IMASOCKET:
8246 + return -ENOPROTOOPT;
8250 + /* FIXME: We assume everything else uses the
8251 + * same level and option numbers. This is true
8252 + * for IPPROTO_TCP(/SOL_TCP) and TCP_NDELAY
8253 + * but is known to be incorrect for other
8254 + * potential options :-(.
8259 + return sys_socketcall(SYS_SETSOCKOPT, sp);
8263 +abi_do_getsockopt(unsigned long *sp)
8266 + int level, optname;
8270 + error = verify_area(VERIFY_READ,
8271 + ((unsigned long *)sp),
8276 + get_user((unsigned long) level, ((unsigned long *)sp)+1);
8277 + get_user((unsigned long) optname, ((unsigned long *)sp)+2);
8278 + get_user((unsigned long) optval, ((unsigned long *)sp)+3);
8279 + get_user((unsigned long) optlen, ((unsigned long *)sp)+4);
8281 +#if defined(CONFIG_ABI_TRACE)
8282 + if (abi_traced(ABI_TRACE_STREAMS|ABI_TRACE_SOCKSYS)) {
8285 + get_user(l, optlen);
8286 + __abi_trace("getsockopt level=%d, optname=%d, optval=0x%08lx, "
8287 + "optlen=0x%08lx[%ld]\n", level, optname,
8288 + (u_long)optval, (u_long)optlen, l);
8293 + case 0: /* IPPROTO_IP aka SOL_IP */
8294 + /* This is correct for the SCO family. Hopefully
8295 + * it is correct for other SYSV...
8300 + if (optname > 4) {
8302 + if (optname <= 33)
8304 + if (optname < 32 || optname > 36)
8307 + put_user(optname, ((unsigned long *)sp)+2);
8311 + put_user(SOL_SOCKET, ((unsigned long *)sp)+1);
8312 + optname = map_value(current_thread_info()->exec_domain->sockopt_map, optname, 0);
8313 + put_user(optname, ((unsigned long *)sp)+2);
8315 + switch (optname) {
8319 + /* SO_LINGER takes a struct linger
8320 + * as the argument but some code
8321 + * uses an int and expects to get
8322 + * away without an error. Sigh...
8324 + get_user(l, optlen);
8325 + if (l == sizeof(int)) {
8326 + put_user(0, (long *)optval);
8332 + /* The following are not currently implemented
8333 + * under Linux so we must fake them in
8334 + * reasonable ways. (Only SO_PROTOTYPE is
8335 + * documented in SCO's man page).
8337 + case SO_PROTOTYPE: {
8338 + unsigned long len;
8339 + error = get_user(len, optlen);
8342 + if (len < sizeof(long))
8345 + error = verify_area(VERIFY_WRITE,
8349 + put_user(0, (long *)optval);
8350 + put_user(sizeof(long),
8359 + return -ENOPROTOOPT;
8361 + case SO_USELOOPBACK:
8364 + case SO_IMASOCKET: {
8365 + unsigned long len;
8366 + error = get_user(len, optlen);
8369 + if (len < sizeof(long))
8372 + error = verify_area(VERIFY_WRITE,
8376 + put_user(1, (long *)optval);
8377 + put_user(sizeof(long),
8385 + /* FIXME: We assume everything else uses the
8386 + * same level and option numbers. This is true
8387 + * for IPPROTO_TCP(/SOL_TCP) and TCP_NDELAY
8388 + * but is known to be incorrect for other
8389 + * potential options :-(.
8394 + return sys_socketcall(SYS_GETSOCKOPT, sp);
8396 diff -Nru linux-2.6.7/abi/svr4/sockio.c linux-2.6.7-abi/abi/svr4/sockio.c
8397 --- linux-2.6.7/abi/svr4/sockio.c 1970-01-01 01:00:00.000000000 +0100
8398 +++ linux-2.6.7-abi/abi/svr4/sockio.c 2004-07-22 17:44:20.000000000 +0200
8402 +#include <linux/config.h>
8403 +#include <linux/errno.h>
8404 +#include <linux/fs.h>
8405 +#include <linux/sched.h>
8406 +#include <linux/kernel.h>
8407 +#include <linux/sockios.h>
8408 +#include <linux/file.h>
8409 +#include <linux/slab.h>
8410 +#include <linux/syscalls.h>
8411 +#include <asm/uaccess.h>
8412 +#include <asm/ioctls.h>
8414 +#include <abi/stream.h>
8415 +#include <abi/tli.h>
8416 +#include <abi/socksys.h> /* for socksys_fdinit */
8418 +#include <abi/svr4/ioctl.h>
8419 +#include <abi/util/trace.h>
8423 + * Check if the inode belongs to /dev/socksys.
8425 +#define IS_SOCKSYS(ip) (MAJOR((ip)->i_rdev) == SOCKSYS_MAJOR)
8429 +i_nread(u_int fd, struct file *fp, struct inode *ip,
8430 + void *data, struct pt_regs *regs)
8434 + error = verify_area(VERIFY_WRITE, data, sizeof(u_long));
8438 +#if defined(CONFIG_ABI_XTI)
8440 + struct T_private *ti = Priv(fp);
8442 + if (IS_SOCKSYS(ip))
8443 + timod_update_socket(fd, fp, regs);
8445 + if (ti && ti->pfirst) {
8446 + put_user(ti->pfirst->length, (u_long *)data);
8448 + return 1; /* at least 1... (FIXME) */
8454 + error = sys_ioctl(fd, TIOCINQ, (long)data);
8455 + if (error == -EINVAL)
8460 + __get_user(error, (u_long *)data);
8468 +i_peek(u_int fd, struct file *fp, struct inode *ip,
8469 + void *data, struct pt_regs *regs)
8471 +#if !defined(CONFIG_ABI_XTI)
8475 + struct T_private *ti = Priv(fp);
8476 + struct T_primsg *tp;
8477 + struct strpeek buf, *uap = data;
8478 + int error = -EFAULT;
8480 + if (copy_from_user(&buf, uap, sizeof(buf)))
8487 + if (IS_SOCKSYS(ip))
8488 + timod_update_socket(fd, fp, regs);
8490 + if (!ti || !ti->pfirst)
8495 + if (!buf.flags || buf.flags == tp->pri) {
8500 + if (buf.ctl.maxlen <= tp->length)
8501 + l = buf.ctl.maxlen;
8505 + if (copy_to_user(buf.ctl.buf,
8506 + ((char *)&tp->type) + ti->offset, l))
8509 + if (put_user(l, &uap->ctl.len))
8512 + if (buf.dat.maxlen >= 0 && put_user(0, &uap->dat.len))
8515 + if (put_user(tp->pri, &uap->flags))
8523 +#endif /* CONFIG_ABI_XTI */
8527 +i_str(u_int fd, struct file *fp, struct inode *ip,
8528 + void *data, struct pt_regs *regs)
8532 + * Unpack the ioctl data and forward as a normal
8533 + * ioctl. Timeouts are not handled (yet?).
8536 + int cmd, timeout, len;
8538 + } it, *uap = data;
8540 + if (copy_from_user(&it, uap, sizeof(struct strioctl)))
8542 + cmd = it.cmd >> 8;
8544 +#if defined(CONFIG_ABI_TRACE)
8545 + abi_trace(ABI_TRACE_STREAMS, "STREAMS I_STR ioctl(%d, 0x%08x, %p)\n",
8546 + fd, it.cmd, it.data);
8549 +#ifdef CONFIG_ABI_XTI
8551 + return timod_ioctl(regs, fd, it.cmd & 0xff, it.data, it.len,
8554 + return __svr4_ioctl(regs, fd, it.cmd, it.data);
8558 +svr4_stream_ioctl(struct pt_regs *regs, int fd, u_int cmd, caddr_t data)
8567 + ip = fp->f_dentry->d_inode;
8570 + * Special hack^H^Hndling for socksys fds
8572 + if (ip->i_sock == 0 && IS_SOCKSYS(ip)) {
8573 + error = socksys_fdinit(fd, 0, NULL, NULL);
8580 + ip = fp->f_dentry->d_inode;
8584 + case 001: /* I_NREAD */
8585 + return i_nread(fd, fp, ip, data, regs);
8587 + case 017: /* I_PEEK */
8588 + return i_peek(fd, fp, ip, data, regs);
8594 + case 010: /* I_STR */
8595 + return i_str(fd, fp, ip, data, regs);
8596 + case 002: { /* I_PUSH */
8599 + /* Get the name anyway to validate it. */
8600 + tmp = getname(data);
8602 + return PTR_ERR(tmp);
8604 +#if defined(CONFIG_ABI_TRACE)
8605 + abi_trace(ABI_TRACE_STREAMS,
8606 + "%d STREAMS I_PUSH %s\n", fd, tmp);
8612 + case 003: /* I_POP */
8613 +#if defined(CONFIG_ABI_TRACE)
8614 + abi_trace(ABI_TRACE_STREAMS, "%d STREAMS I_POP\n", fd);
8618 + case 005: /* I_FLUSH */
8621 + case 013: { /* I_FIND */
8624 + /* Get the name anyway to validate it. */
8625 + tmp = getname(data);
8627 + return PTR_ERR(tmp);
8629 +#if defined(CONFIG_ABI_TRACE)
8630 + abi_trace(ABI_TRACE_STREAMS,
8631 + "%d STREAMS I_FIND %s\n", fd, tmp);
8633 +#ifdef CONFIG_ABI_XTI
8634 + if (!strcmp(tmp, "timod")) {
8643 + /* FIXME: These are bogus. */
8644 + case 011: /* I_SETSIG */
8645 + return sys_ioctl(fd, FIOSETOWN, (long)current->pid);
8646 + case 012: /* I_GETSIG */
8647 + return sys_ioctl(fd, FIOGETOWN, (long)data);
8649 + case 020: /* I_FDINSERT */
8650 +#ifdef CONFIG_ABI_XTI
8651 + return stream_fdinsert(regs, fd,
8652 + (struct strfdinsert *)data);
8657 + case 004: /* I_LOOK */
8658 + case 006: /* I_SRDOPT */
8659 + case 007: /* I_GRDOPT */
8660 + case 014: /* I_LINK */
8661 + case 015: /* I_UNLINK */
8662 + case 021: /* I_SENDFD */
8663 + case 022: /* I_RECVFD */
8664 + case 023: /* I_SWROPT */
8665 + case 040: /* I_SETCLTIME */
8666 + return 0; /* Lie... */
8667 + case 042: /* I_CANPUT */
8669 + * Arg is the priority band in question. We only
8670 + * support one priority band so data must be 0.
8671 + * If the band is writable we should return 1, if
8672 + * the band is flow controlled we should return 0.
8677 + /* FIXME: How can we test if a write would block? */
8680 + case 024: /* I_GWROPT */
8681 + case 025: /* I_LIST */
8682 + case 026: /* I_PLINK */
8683 + case 027: /* I_PUNLINK */
8684 + case 030: /* I_SETEV */
8685 + case 031: /* I_GETEV */
8686 + case 032: /* I_STREV */
8687 + case 033: /* I_UNSTREV */
8688 + case 034: /* I_FLUSHBAND */
8689 + case 035: /* I_CKBAND */
8690 + case 036: /* I_GETBAND */
8691 + case 037: /* I_ATMARK */
8692 + case 041: /* I_GETCLTIME */
8693 + /* Unsupported - drop out. */
8700 + printk(KERN_ERR "iBCS: STREAMS ioctl 0%o unsupported\n", cmd);
8704 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
8705 +EXPORT_SYMBOL(svr4_stream_ioctl);
8707 diff -Nru linux-2.6.7/abi/svr4/socksys.c linux-2.6.7-abi/abi/svr4/socksys.c
8708 --- linux-2.6.7/abi/svr4/socksys.c 1970-01-01 01:00:00.000000000 +0100
8709 +++ linux-2.6.7-abi/abi/svr4/socksys.c 2004-07-22 17:44:20.000000000 +0200
8712 + * socksys.c - SVR4 /dev/socksys emulation
8714 + * Copyright (c) 1994-1996 Mike Jagdis (jaggy@purplet.demon.co.uk)
8715 + * Copyright (c) 2001 Caldera Deutschland GmbH
8716 + * Copyright (c) 2001 Christoph Hellwig
8721 +#include <linux/config.h>
8722 +#include <linux/module.h>
8724 +#include <linux/types.h>
8725 +#include <linux/errno.h>
8726 +#include <linux/fs.h>
8727 +#include <linux/fcntl.h>
8728 +#include <linux/major.h>
8729 +#include <linux/kernel.h>
8730 +#include <linux/in.h>
8731 +#include <linux/net.h>
8732 +#include <linux/sched.h>
8733 +#include <linux/signal.h>
8734 +#include <linux/socket.h>
8735 +#include <net/sock.h>
8736 +#include <linux/slab.h>
8737 +#include <linux/mm.h>
8738 +#include <linux/un.h>
8739 +#include <linux/utsname.h>
8740 +#include <linux/time.h>
8741 +#include <linux/termios.h>
8742 +#include <linux/sys.h>
8743 +#include <linux/file.h>
8744 +#include <linux/poll.h>
8745 +#include <linux/capability.h>
8746 +#include <linux/personality.h>
8747 +#include <linux/init.h>
8748 +#include <linux/syscalls.h>
8749 +#include <linux/namei.h>
8751 +#include <asm/uaccess.h>
8753 +#include <abi/stream.h>
8754 +#include <abi/socksys.h>
8755 +#include <abi/svr4/sockio.h>
8756 +#include <abi/svr4/sysent.h>
8757 +#include <abi/tli.h>
8759 +#include <abi/util/map.h>
8760 +#include <abi/util/trace.h>
8761 +#include <abi/util/revalidate.h>
8765 + * External declarations.
8770 + * Forward declarations.
8772 +static int socksys_open(struct inode *ip, struct file *fp);
8773 +#if defined(CONFIG_ABI_XTI)
8774 +static int socksys_release(struct inode *ip, struct file *fp);
8775 +static u_int socksys_poll(struct file *fp, struct poll_table_struct *wait);
8777 +static int socksys_read(struct file *fp, char *buf,
8778 + size_t count, loff_t *ppos);
8779 +static int socksys_write(struct file *fp, const char *buf,
8780 + size_t count, loff_t *ppos);
8783 + * The socksys socket file operations.
8784 + * This gets filled in on module initialization.
8786 +static struct file_operations socksys_socket_fops = {
8791 + * File operations for the user-visible device files.
8793 + * While open the files are handled as sockets.
8795 +static struct file_operations socksys_fops = {
8796 + owner: THIS_MODULE,
8797 + open: socksys_open,
8798 + read: socksys_read,
8799 + write: socksys_write,
8800 +#ifdef CONFIG_ABI_XTI
8801 + poll: socksys_poll,
8802 + release: socksys_release,
8808 +inherit_socksys_funcs(u_int fd, int state)
8812 +#ifdef CONFIG_ABI_XTI
8813 + struct T_private *tp;
8815 + struct socket *sp;
8820 + ip = fp->f_dentry->d_inode;
8823 + * SYSV sockets are BSD like with respect to ICMP errors
8824 + * with UDP rather than RFC conforming. I think.
8826 + sp = SOCKET_I(ip); /* inode -> socket */
8828 + sock_set_flag(sp->sk, SOCK_BSDISM);
8830 + ip->i_mode = 0020000; /* S_IFCHR */
8831 + ip->i_rdev = MKDEV(SOCKSYS_MAJOR, 0);
8833 +#ifdef CONFIG_ABI_XTI
8834 + tp = kmalloc(sizeof(struct T_private), GFP_KERNEL);
8836 + tp->magic = XTI_MAGIC;
8837 + tp->state = state;
8839 + tp->pfirst = NULL;
8842 + fp->private_data = tp;
8845 + fp->f_op = &socksys_socket_fops;
8850 +spx_connect(u_int fd, int spxnum)
8852 + struct sockaddr_un sun;
8856 +#if defined(CONFIG_ABI_TRACE)
8857 + abi_trace(ABI_TRACE_SOCKSYS,
8858 + "SPX: %u choose service %d\n", fd, spxnum);
8862 + * Rather than use an explicit path to the X :0 server
8863 + * socket we should use the given number to look up a path
8864 + * name to use (we can't rely on servers registering their
8865 + * sockets either - for one thing we don't emulate that yet
8866 + * and for another thing different OS binaries do things in
8867 + * different ways but all must interoperate).
8868 + * I suggest putting the mapping in, say, /dev/spx.map/%d
8869 + * where each file is a symlink containing the path of the
8870 + * socket to use. Then we can just do a readlink() here to
8871 + * get the pathname.
8872 + * Hey, this is what we do here now!
8874 + sun.sun_family = AF_UNIX;
8875 + sprintf(sun.sun_path, "/dev/spx.map/%u", spxnum);
8879 + err = sys_readlink(sun.sun_path, sun.sun_path, strlen(sun.sun_path));
8882 + if (err == -ENOENT) {
8883 +#if defined(CONFIG_ABI_TRACE)
8884 + abi_trace(ABI_TRACE_SOCKSYS,
8885 + "SPX: %u no symlink \"%s\", try X :0\n",
8886 + fd, sun.sun_path);
8888 + strcpy(sun.sun_path, "/tmp/.X11-unix/X0");
8889 + } else if (err < 0) {
8890 +#if defined(CONFIG_ABI_TRACE)
8891 + abi_trace(ABI_TRACE_SOCKSYS,
8892 + "SPX: readlink failed with %d\n", err);
8896 + sun.sun_path[err] = '\0';
8899 + newfd = sys_socket(AF_UNIX, SOCK_STREAM, 0);
8903 +#if defined(CONFIG_ABI_TRACE)
8904 + abi_trace(ABI_TRACE_SOCKSYS,
8905 + "SPX: %u got no UNIX domain socket (err=%d)\n",
8911 +#if defined(CONFIG_ABI_TRACE)
8912 + abi_trace(ABI_TRACE_SOCKSYS,
8913 + "SPX: %u got a UNIX domain socket\n", fd);
8917 + err = sys_connect(newfd, (struct sockaddr *)&sun, sizeof(struct sockaddr_un));
8921 +#if defined(CONFIG_ABI_TRACE)
8922 + abi_trace(ABI_TRACE_SOCKSYS,
8923 + "SPX: %u connect to \"%s\" failed (err = %d)\n",
8924 + fd, sun.sun_path, err);
8930 +#if defined(CONFIG_ABI_TRACE)
8931 + abi_trace(ABI_TRACE_SOCKSYS,
8932 + "SPX: %u connect to \"%s\"\n",
8933 + fd, sun.sun_path);
8939 + * XTI to Linux protocol table.
8941 +static int inet_prot[16] = {
8942 + IPPROTO_ICMP, IPPROTO_ICMP,
8943 + IPPROTO_IGMP, IPPROTO_IPIP,
8944 + IPPROTO_TCP, IPPROTO_EGP,
8945 + IPPROTO_PUP, IPPROTO_UDP,
8946 + IPPROTO_IDP, IPPROTO_RAW,
8949 +static int inet_type[16] = {
8950 + SOCK_RAW, SOCK_RAW,
8951 + SOCK_RAW, SOCK_RAW,
8952 + SOCK_STREAM, SOCK_RAW,
8953 + SOCK_RAW, SOCK_DGRAM,
8954 + SOCK_RAW, SOCK_RAW,
8959 +xti_connect(struct file *fp, u_int fd, dev_t dev)
8961 + int family, type, prot = 0, i, s;
8964 +#if defined(CONFIG_ABI_TRACE)
8965 + abi_trace(ABI_TRACE_SOCKSYS,
8966 + "XTI: %d get socket for transport end point "
8967 + "(dev = 0x%04x)\n", fd, dev);
8970 + switch ((family = ((MINOR(dev) >> 4) & 0x0f))) {
8972 + type = SOCK_STREAM;
8975 + i = MINOR(dev) & 0x0f;
8976 + type = inet_type[i];
8977 + prot = inet_prot[i];
8986 +#if defined(CONFIG_ABI_TRACE)
8987 + abi_trace(ABI_TRACE_SOCKSYS,
8988 + "XTI: %d socket %d %d %d\n",
8989 + fd, family, type, prot);
8994 + s = sys_socket(family, type, prot);
9001 +socksys_fdinit(int fd, int rw, const char *buf, int *count)
9005 + int sockfd, error = -EINVAL;
9007 +#if defined(CONFIG_ABI_TRACE)
9008 + abi_trace(ABI_TRACE_SOCKSYS, "socksys: fd=%d initializing\n", fd);
9014 + ip = fp->f_dentry->d_inode;
9017 + * Minor = 0 is the socksys device itself. No special handling
9018 + * will be needed as it is controlled by the application
9021 + if (MINOR(ip->i_rdev) == 0)
9025 + * Minor = 1 is the spx device. This is the client side of a
9026 + * streams pipe to the X server. Under SCO and friends
9027 + * the library code messes around setting the connection
9028 + * up itself. We do it ourselves - this means we don't
9029 + * need to worry about the implementation of the server
9030 + * side (/dev/X0R - which must exist but can be a link
9031 + * to /dev/null) nor do we need to actually implement
9034 + if (MINOR(ip->i_rdev) == 1) {
9038 + * It seems early spx implementations were just a
9039 + * quick hack to get X to work. They only supported
9040 + * one destination and connected automatically.
9041 + * Later versions take a single byte write, the
9042 + * value of the byte telling them which destination
9043 + * to connect to. Hence this quick hack to work
9044 + * with both. If the first write is a single byte
9045 + * it's a connect request otherwise we auto-connect
9046 + * to destination 1.
9049 + if (rw == 1 && *count == 1) {
9050 + error = get_user(unit, buf);
9059 + sockfd = spx_connect(fd, unit);
9062 + * Otherwise the high 4 bits specify the address/protocol
9063 + * family (AF_INET, AF_UNIX etc.) and the low 4 bits determine
9064 + * the protocol (IPPROTO_IP, IPPROTO_UDP, IPPROTO_TCP etc.)
9065 + * although not using a one-to-one mapping as the minor number
9066 + * is not big enough to hold everything directly. The socket
9067 + * type is inferrred from the protocol.
9069 + sockfd = xti_connect(fp, fd, ip->i_rdev);
9073 + * Give up if we weren't able to allocate a socket.
9074 + * There is no sense in plying our funny game without a new fd.
9080 + * Redirect operations on the socket fd via our emulation
9081 + * handlers then swap the socket fd and the original fd,
9082 + * discarding the original fd.
9084 + inherit_socksys_funcs(sockfd, TS_UNBND);
9086 +#if defined(CONFIG_ABI_TRACE)
9087 + abi_trace(ABI_TRACE_SOCKSYS, "XTI: %d -> %d\n", fd, sockfd);
9090 + sys_dup2(sockfd, fd);
9091 + sys_close(sockfd);
9100 +socksys_open(struct inode *ip, struct file *fp)
9102 +#if defined(CONFIG_ABI_TRACE)
9103 + abi_trace(ABI_TRACE_SOCKSYS,
9104 + "socksys: fp=0x%p, ip=0x%p opening\n", fp, ip);
9109 +#ifdef CONFIG_ABI_XTI
9111 +socksys_release(struct inode *ip, struct file *fp)
9116 + * Not being a socket is not an error - it is probably
9117 + * just the pseudo device transport provider.
9119 + if (!ip || !ip->i_sock)
9122 + if (fp->private_data) {
9123 + struct T_primsg *it;
9125 + it = ((struct T_private *)fp->private_data)->pfirst;
9127 + struct T_primsg *tmp = it;
9131 + kfree(fp->private_data);
9133 + error = socket_file_ops.release(ip, fp);
9135 +#if defined(CONFIG_ABI_TRACE)
9136 + abi_trace(ABI_TRACE_SOCKSYS, "socksys: %p closed\n", fp);
9142 +socksys_poll(struct file *fp, struct poll_table_struct *wait)
9144 + struct inode *ip = fp->f_dentry->d_inode;
9148 + * If this is a timod transport end point and there
9149 + * is a control message queued we have readable data.
9151 + if (ip && ip->i_sock && MINOR(ip->i_rdev) != 1) {
9152 + if (Priv(fp) && Priv(fp)->pfirst) {
9153 + if (Priv(fp)->pfirst->pri == MSG_HIPRI)
9160 + return (mask | socket_file_ops.poll(fp, wait));
9165 +socksys_read(struct file *fp, char *buf, size_t count, loff_t *ppos)
9169 + if (fp->f_dentry->d_inode->i_sock)
9172 + for (fd = 0; fd < current->files->max_fdset; fd++) {
9173 + if (fcheck(fd) == fp) {
9174 + error = socksys_fdinit(fd, 0, NULL, NULL);
9179 + return fp->f_op->read(fp, buf, count, ppos);
9187 +socksys_write(struct file *fp, const char *buf, size_t count, loff_t *ppos)
9191 + if (fp->f_dentry->d_inode->i_sock)
9194 + for (fd = 0; fd < current->files->max_fdset; fd++) {
9195 + if (fcheck(fd) == fp) {
9196 + error = socksys_fdinit(fd, 1, buf, &count);
9203 + printk("count=%d\n", count);
9204 + return fp->f_op->write(fp, buf, count, ppos);
9213 + * Get a socket but replace the socket file
9214 + * operations with our own so we can do the
9215 + * right thing for ioctls.
9218 +socksys_socket(u_long *sp)
9223 + get_user(x, ((u_long *)sp)+0);
9224 + put_user(map_value(current_thread_info()->exec_domain->af_map, x, 0), sp+0);
9225 + get_user(x, ((u_long *)sp)+1);
9226 + put_user(map_value(current_thread_info()->exec_domain->socktype_map, x, 0), sp+1);
9228 + fd = sys_socketcall(SYS_SOCKET, sp);
9230 + inherit_socksys_funcs(fd, TS_UNBND);
9235 +socksys_accept(u_long *sp)
9239 + fd = sys_socketcall(SYS_ACCEPT, sp);
9241 + inherit_socksys_funcs(fd, TS_DATA_XFER);
9246 +socksys_getipdomain(u_long *sp)
9251 + error = get_user((u_long)name, (char *)(sp+0));
9255 + get_user(len, sp+1);
9259 + down_read(&uts_sem);
9260 + error = verify_area(VERIFY_WRITE, name, len);
9263 + for (p = system_utsname.nodename; *p && *p != '.'; p++)
9268 + p = system_utsname.domainname;
9270 + if (strcmp(p, "(none)")) {
9271 + for (; *p && len > 0; p++,len--) {
9272 + __put_user(*p, name);
9276 + __put_user('\0', name);
9278 + up_read(&uts_sem);
9283 +socksys_setipdomain(u_long *sp)
9286 + int error, len, togo;
9288 + if (!capable(CAP_SYS_ADMIN))
9291 + error = get_user((unsigned long) name, (char *)(sp+0));
9295 + error = get_user(len, sp+1);
9299 + down_write(&uts_sem);
9300 + togo = __NEW_UTS_LEN;
9301 + for (p = system_utsname.nodename; *p && *p != '.'; p++,togo--)
9307 + if (len <= togo) {
9308 + while (len-- > 0) {
9309 + get_user(*p, name);
9316 + up_write(&uts_sem);
9321 +socksys_setreugid(int cmd, u_long *sp)
9326 + error = get_user(ruid, sp+0);
9330 + error = get_user(euid, sp+1);
9334 + return (cmd == SSYS_SO_SETREUID) ?
9335 + sys_setreuid16(ruid, euid) :
9336 + sys_setregid16(ruid, euid);
9340 + * Get a socketpair but replace the socket file
9341 + * operations with our own so we can do the
9342 + * right thing for ioctls.
9345 +socksys_socketpair(u_long *sp)
9350 + int pairin[2], pairout[2];
9354 + * The first two arguments are file descriptors
9355 + * of sockets which have already been opened
9356 + * and should now be connected back to back.
9358 + error = get_user(pairin[0], sp+0);
9360 + error = get_user(pairin[1], sp+1);
9364 + fp = fget(pairin[0]);
9367 + ip = fp->f_dentry->d_inode;
9369 + fput(fp); /* this looks boguos */
9370 + if (!ip || !ip->i_sock)
9375 + * XXX Do we need to close these here?
9376 + * XXX If we fail to connect them should they be open?
9378 + sys_close(pairin[0]);
9379 + sys_close(pairin[1]);
9383 + error = sys_socketpair(AF_UNIX, SOCKET_I(ip)->type, 0, pairout);
9389 + if (pairout[0] != pairin[0]) {
9390 + sys_dup2(pairout[0], pairin[0]);
9391 + sys_close(pairout[0]);
9394 + if (pairout[1] != pairin[1]) {
9395 + sys_dup2(pairout[1], pairin[1]);
9396 + sys_close(pairout[1]);
9399 + inherit_socksys_funcs(pairin[0], TS_DATA_XFER);
9400 + inherit_socksys_funcs(pairin[1], TS_DATA_XFER);
9405 +socksys_syscall(u_long *sp)
9409 + error = get_user(cmd, sp);
9414 +#if defined(CONFIG_ABI_TRACE)
9415 + if (abi_traced(ABI_TRACE_SOCKSYS)) {
9416 + u_long a0, a1, a2, a3, a4, a5;
9417 + static const char * const cmd_map[] = {
9418 + "", "accept", "bind", "connect", "getpeername",
9419 + "getsockname", "getsockopt", "listen", "recv",
9420 + "recvfrom", "send", "sendto", "setsockopt", "shutdown",
9421 + "socket", "select", "getipdomain", "setipdomain",
9422 + "adjtime", "setreuid", "setregid", "gettimeofday",
9423 + "settimeofday", "getitimer", "setitimer",
9424 + "recvmsg", "sendmsg", "sockpair"
9427 + get_user(a0, sp+0);
9428 + get_user(a1, sp+1);
9429 + get_user(a2, sp+2);
9430 + get_user(a3, sp+3);
9431 + get_user(a4, sp+4);
9432 + get_user(a5, sp+5);
9434 + __abi_trace("socksys: %s (%d) "
9435 + "<0x%lx,0x%lx,0x%lx,0x%lx,0x%lx,0x%lx>\n",
9437 + cmd < sizeof(cmd_map) / sizeof(cmd_map[0]))
9438 + ? cmd_map[cmd] : "???", cmd,
9439 + a0, a1, a2, a3, a4, a5);
9444 + case SSYS_SO_SOCKET:
9445 + return socksys_socket(sp);
9446 + case SSYS_SO_ACCEPT:
9447 + return socksys_accept(sp);
9448 + case SSYS_SO_BIND:
9449 + return sys_socketcall(SYS_BIND, sp);
9450 + case SSYS_SO_CONNECT:
9451 + return sys_socketcall(SYS_CONNECT, sp);
9452 + case SSYS_SO_GETPEERNAME:
9453 + return sys_socketcall(SYS_GETPEERNAME, sp);
9454 + case SSYS_SO_GETSOCKNAME:
9455 + return sys_socketcall(SYS_GETSOCKNAME, sp);
9456 + case SSYS_SO_GETSOCKOPT:
9457 + return abi_do_getsockopt((u_long *)sp);
9458 + case SSYS_SO_LISTEN:
9459 + return sys_socketcall(SYS_LISTEN, sp);
9460 + case SSYS_SO_RECV:
9461 + if ((error = sys_socketcall(SYS_RECV, sp)) == -EAGAIN)
9462 + return -EWOULDBLOCK;
9464 + case SSYS_SO_RECVFROM:
9465 + if ((error = sys_socketcall(SYS_RECVFROM, sp)) == -EAGAIN)
9466 + return -EWOULDBLOCK;
9468 + case SSYS_SO_SEND:
9469 + if ((error = sys_socketcall(SYS_SEND, sp)) == -EAGAIN)
9470 + error = -EWOULDBLOCK;
9472 + case SSYS_SO_SENDTO:
9473 + if ((error = sys_socketcall(SYS_SENDTO, sp)) == -EAGAIN)
9474 + error = -EWOULDBLOCK;
9476 + case SSYS_SO_SETSOCKOPT:
9477 + return abi_do_setsockopt(sp);
9478 + case SSYS_SO_SHUTDOWN:
9479 + return sys_socketcall(SYS_SHUTDOWN, sp);
9480 + case SSYS_SO_GETIPDOMAIN:
9481 + return socksys_getipdomain(sp);
9482 + case SSYS_SO_SETIPDOMAIN:
9483 + return socksys_setipdomain(sp);
9484 + case SSYS_SO_SETREUID:
9485 + case SSYS_SO_SETREGID:
9486 + return socksys_setreugid(cmd, sp);
9487 + case SSYS_SO_GETTIME:
9488 + case SSYS_SO_SETTIME:
9490 + struct timeval *tv;
9491 + struct timezone *tz;
9493 + error = get_user((unsigned long) tv, sp+0);
9495 + error = get_user((unsigned long) tz, sp+1);
9498 + return (cmd == SSYS_SO_GETTIME)
9499 + ? sys_gettimeofday(tv, tz)
9500 + : sys_settimeofday(tv, tz);
9503 + case SSYS_SO_GETITIMER:
9506 + struct itimerval *value;
9508 + error = get_user((unsigned long) which, sp+0);
9510 + error = get_user((unsigned long) value, sp+1);
9513 + return sys_getitimer(which, value);
9515 + case SSYS_SO_SETITIMER:
9518 + struct itimerval *value, *ovalue;
9520 + error = get_user((unsigned long) which, sp+0);
9522 + error = get_user((unsigned long) value, sp+1);
9524 + error = get_user((unsigned long) ovalue, sp+2);
9527 + return sys_setitimer(which, value, ovalue);
9531 + case SSYS_SO_SELECT:
9533 + * This may be wrong? I don't know how to trigger
9534 + * this case. Select seems to go via the Xenix
9535 + * select entry point.
9537 + return sys_select(sp);
9540 + case SSYS_SO_ADJTIME:
9544 + * These appear in SCO 3.2v5. I assume that the format of
9545 + * a msghdr is identical with Linux. I have not checked.
9547 + case SSYS_SO_RECVMSG:
9548 + if ((error = sys_socketcall(SYS_RECVMSG, sp)) == -EAGAIN)
9549 + error = -EWOULDBLOCK;
9551 + case SSYS_SO_SENDMSG:
9552 + if ((error = sys_socketcall(SYS_SENDMSG, sp)) == -EAGAIN)
9553 + error = -EWOULDBLOCK;
9555 + case SSYS_SO_SOCKPAIR:
9556 + return socksys_socketpair(sp);
9563 +socksys_getdomainname(caddr_t arg)
9565 + struct domnam_args dn;
9569 + if (copy_from_user(&dn, arg, sizeof(struct domnam_args)))
9572 + down_read(&uts_sem);
9573 + error = verify_area(VERIFY_WRITE, dn.name, dn.namelen);
9576 + for (p = system_utsname.domainname; *p && dn.namelen > 0; p++) {
9577 + __put_user(*p, dn.name);
9581 + __put_user('\0', dn.name);
9583 + up_read(&uts_sem);
9588 +socksys_setdomainname(caddr_t arg)
9590 + struct domnam_args dn;
9592 + if (copy_from_user(&dn, arg, sizeof(struct domnam_args)))
9594 + return sys_setdomainname(dn.name, dn.namelen);
9598 + * I think this was used before symlinks were added
9599 + * to the base SCO OS?
9602 +socksys_lstat(caddr_t arg)
9604 + struct lstat_args st;
9606 + if (copy_from_user(&st, arg, sizeof(struct lstat_args)))
9608 + return svr4_lstat(st.fname, st.statb);
9612 +socksys_getfh(caddr_t arg)
9614 + struct getfh_args gf;
9615 + struct nameidata nd;
9618 + if (!capable(CAP_SYS_ADMIN))
9621 + if (copy_from_user(&gf, arg, sizeof(struct getfh_args)))
9624 + error = verify_area(VERIFY_WRITE, gf.fhp, sizeof(fhandle_t));
9628 + error = user_path_walk(gf.fname, &nd);
9632 + error = do_revalidate(nd.dentry);
9634 + struct inode *ip = nd.dentry->d_inode;
9636 + __put_user(ip->i_rdev, &gf.fhp->fh.fsid);
9637 + __put_user(ip->i_ino, &gf.fhp->fh.fno);
9638 + __put_user(0L, &gf.fhp->fh.fgen);
9639 + __put_user(ip->i_rdev, &gf.fhp->fh.ex_fsid);
9640 + __put_user(ip->i_ino, &gf.fhp->fh.ex_fno);
9641 + __put_user(0L, &gf.fhp->fh.ex_fgen);
9644 + path_release(&nd);
9649 +socksys_getpeername(int fd, caddr_t arg)
9651 + struct sockaddr uaddr;
9656 + addrlen = sizeof(struct sockaddr);
9658 + error = verify_area(VERIFY_WRITE, arg, addrlen);
9664 + error = sys_getpeername(fd, &uaddr, &addrlen);
9668 + copy_to_user(arg, &uaddr, addrlen);
9673 +socksys_getsockname(int fd, caddr_t arg)
9675 + struct sockaddr uaddr;
9680 + addrlen = sizeof(struct sockaddr);
9682 + error = verify_area(VERIFY_WRITE, arg, addrlen);
9688 + error = sys_getsockname(fd, &uaddr, &addrlen);
9692 + copy_to_user(arg, &uaddr, addrlen);
9697 +socksys_gifonep(caddr_t data)
9699 + return -EOPNOTSUPP;
9703 +socksys_sifonep(caddr_t data)
9706 + struct svr4_ifreq *ifr = (struct svr4_ifreq *)data;
9708 + printk("SIOCSIFONEP (spsize = %x, spthresh = %x) not supported\n",
9709 + ifr->svr4_ifr_onepacket.spsize,
9710 + ifr->svr4_ifr_onepacket.spthresh);
9712 + return -EOPNOTSUPP;
9716 +abi_ioctl_socksys(int fd, unsigned int cmd, caddr_t arg)
9722 + * Strictly the ip domain and nis domain are separate and
9723 + * distinct under SCO but Linux only has the one domain.
9725 + case NIOCGETDOMNAM:
9726 + return socksys_getdomainname(arg);
9727 + case NIOCSETDOMNAM:
9728 + return socksys_setdomainname(arg);
9730 + return socksys_lstat(arg);
9731 + case NIOCOLDGETFH:
9733 + return socksys_getfh(arg);
9736 + case NIOCCLNTHAND:
9737 + case NIOCEXPORTFS:
9740 + case SSYS_SIOCSOCKSYS: /* Pseudo socket syscall */
9741 + case SVR4_SIOCSOCKSYS:
9742 + return socksys_syscall((u_long *)arg);
9744 + case SSYS_SIOCSHIWAT: /* set high watermark */
9745 + case SVR4_SIOCSHIWAT:
9746 + case SSYS_SIOCSLOWAT: /* set low watermark */
9747 + case SVR4_SIOCSLOWAT:
9749 + * Linux doesn't support them but lie anyway
9750 + * or some things take it as fatal (why?)
9752 + * FIXME: actually we can do this now...
9755 + case SSYS_SIOCGHIWAT: /* get high watermark */
9756 + case SVR4_SIOCGHIWAT:
9757 + case SSYS_SIOCGLOWAT: /* get low watermark */
9758 + case SVR4_SIOCGLOWAT:
9760 + * Linux doesn't support them but lie anyway
9761 + * or some things take it as fatal (why?)
9763 + * FIXME: actually we can do this now...
9765 + if ((error = verify_area(VERIFY_WRITE, arg, sizeof(u_long))))
9767 + put_user(0, (u_long *)arg);
9769 + case SSYS_SIOCATMARK: /* at oob mark? */
9770 + case SVR4_SIOCATMARK:
9771 + return sys_ioctl(fd, SIOCATMARK, (long)arg);
9773 + case SSYS_SIOCSPGRP: /* set process group */
9774 + case SVR4_SIOCSPGRP:
9775 + return sys_ioctl(fd, SIOCSPGRP, (long)arg);
9776 + case SSYS_SIOCGPGRP: /* get process group */
9777 + case SVR4_SIOCGPGRP:
9778 + return sys_ioctl(fd, SIOCGPGRP, (long)arg);
9781 + case SSYS_FIONREAD: /* BSD compatibilty */
9782 + error = sys_ioctl(fd, TIOCINQ, (long)arg);
9783 +#if defined(CONFIG_ABI_TRACE)
9784 + if (!error && abi_traced(ABI_TRACE_SOCKSYS)) {
9787 + get_user(n, (u_long *)arg);
9788 + __abi_trace("socksys: %d FIONREAD "
9789 + "found %lu bytes ready\n",
9794 + case SSYS_FIONBIO: /* BSD compatibilty */
9795 + return sys_ioctl(fd, FIONBIO, (long)arg);
9796 + case SSYS_FIOASYNC: /* BSD compatibilty */
9797 + return sys_ioctl(fd, FIOASYNC, (long)arg);
9798 + case SSYS_SIOCADDRT: /* add route */
9799 + case SVR4_SIOCADDRT:
9800 + return sys_ioctl(fd, SIOCADDRT, (long)arg);
9801 + case SSYS_SIOCDELRT: /* delete route */
9802 + case SVR4_SIOCDELRT:
9803 + return sys_ioctl(fd, SIOCDELRT, (long)arg);
9804 + case SSYS_SIOCSIFADDR: /* set ifnet address */
9805 + case SVR4_SIOCSIFADDR:
9806 + return sys_ioctl(fd, SIOCSIFADDR, (long)arg);
9807 + case SSYS_SIOCGIFADDR: /* get ifnet address */
9808 + case SVR4_SIOCGIFADDR:
9809 + return sys_ioctl(fd, SIOCGIFADDR, (long)arg);
9810 + case SSYS_SIOCSIFDSTADDR: /* set p-p address */
9811 + case SVR4_SIOCSIFDSTADDR:
9812 + return sys_ioctl(fd, SIOCSIFDSTADDR, (long)arg);
9813 + case SSYS_SIOCGIFDSTADDR: /* get p-p address */
9814 + case SVR4_SIOCGIFDSTADDR:
9815 + return sys_ioctl(fd, SIOCGIFDSTADDR, (long)arg);
9816 + case SSYS_SIOCSIFFLAGS: /* set ifnet flags */
9817 + case SVR4_SIOCSIFFLAGS:
9818 + return sys_ioctl(fd, SIOCSIFFLAGS, (long)arg);
9819 + case SSYS_SIOCGIFFLAGS: /* get ifnet flags */
9820 + case SVR4_SIOCGIFFLAGS:
9822 + case SVRX_SIOCGIFFLAGS:
9824 + return sys_ioctl(fd, SIOCGIFFLAGS, (long)arg);
9825 + case SSYS_SIOCGIFCONF: /* get ifnet list */
9826 + case SVR4_SIOCGIFCONF:
9828 + case SVRX_SIOCGIFCONF:
9830 + return sys_ioctl(fd, SIOCGIFCONF, (long)arg);
9831 + case SSYS_SIOCGIFBRDADDR: /* get broadcast addr */
9832 + case SVR4_SIOCGIFBRDADDR:
9833 + return sys_ioctl(fd, SIOCGIFBRDADDR, (long)arg);
9834 + case SSYS_SIOCSIFBRDADDR: /* set broadcast addr */
9835 + case SVR4_SIOCSIFBRDADDR:
9836 + return sys_ioctl(fd, SIOCSIFBRDADDR, (long)arg);
9837 + case SSYS_SIOCGIFNETMASK: /* get net addr mask */
9838 + case SVR4_SIOCGIFNETMASK:
9839 + return sys_ioctl(fd, SIOCGIFNETMASK, (long)arg);
9840 + case SSYS_SIOCSIFNETMASK: /* set net addr mask */
9841 + return sys_ioctl(fd, SIOCSIFNETMASK, (long)arg);
9842 + case SSYS_SIOCGIFMETRIC: /* get IF metric */
9843 + case SVR4_SIOCGIFMETRIC:
9844 + return sys_ioctl(fd, SIOCGIFMETRIC, (long)arg);
9845 + case SSYS_SIOCSIFMETRIC: /* set IF metric */
9846 + case SVR4_SIOCSIFMETRIC:
9847 + return sys_ioctl(fd, SIOCSIFMETRIC, (long)arg);
9848 + case SSYS_SIOCSARP: /* set arp entry */
9849 + case SVR4_SIOCSARP:
9850 + return sys_ioctl(fd, SIOCSARP, (long)arg);
9851 + case SSYS_SIOCGARP: /* get arp entry */
9852 + case SVR4_SIOCGARP:
9853 + return sys_ioctl(fd, SIOCGARP, (long)arg);
9854 + case SSYS_SIOCDARP: /* delete arp entry */
9855 + case SVR4_SIOCDARP:
9856 + return sys_ioctl(fd, SIOCDARP, (long)arg);
9857 + case SSYS_SIOCGENADDR: /* Get ethernet addr */
9858 + case SVR4_SIOCGENADDR:
9859 + return sys_ioctl(fd, SIOCGIFHWADDR, (long)arg);
9860 + case SSYS_SIOCSIFMTU: /* get if_mtu */
9861 + case SVR4_SIOCSIFMTU:
9862 + return sys_ioctl(fd, SIOCSIFMTU, (long)arg);
9863 + case SSYS_SIOCGIFMTU: /* set if_mtu */
9864 + case SVR4_SIOCGIFMTU:
9865 + return sys_ioctl(fd, SIOCGIFMTU, (long)arg);
9867 + case SSYS_SIOCGETNAME: /* getsockname */
9868 + case SVR4_SIOCGETNAME:
9869 + return socksys_getsockname(fd, arg);
9870 + case SSYS_SIOCGETPEER: /* getpeername */
9871 + case SVR4_SIOCGETPEER:
9872 + return socksys_getpeername(fd, arg);
9874 + case SSYS_IF_UNITSEL: /* set unit number */
9875 + case SVR4_IF_UNITSEL:
9876 + case SSYS_SIOCXPROTO: /* empty proto table */
9877 + case SVR4_SIOCXPROTO:
9879 + case SSYS_SIOCIFDETACH: /* detach interface */
9880 + case SVR4_SIOCIFDETACH:
9881 + case SSYS_SIOCGENPSTATS: /* get ENP stats */
9882 + case SVR4_SIOCGENPSTATS:
9884 + case SSYS_SIOCSIFNAME: /* set interface name */
9885 + case SVR4_SIOCSIFNAME:
9887 + case SSYS_SIOCPROTO: /* link proto */
9888 + case SVR4_SIOCPROTO:
9889 + case SSYS_SIOCX25XMT:
9890 + case SVR4_SIOCX25XMT:
9891 + case SSYS_SIOCX25RCV:
9892 + case SVR4_SIOCX25RCV:
9893 + case SSYS_SIOCX25TBL:
9894 + case SVR4_SIOCX25TBL:
9896 + case SSYS_SIOCGIFONEP: /* get one-packet params */
9897 + return socksys_gifonep(arg);
9898 + case SSYS_SIOCSIFONEP: /* set one-packet params */
9899 + return socksys_sifonep(arg);
9902 + printk(KERN_DEBUG "%d iBCS: socksys: %d: ioctl 0x%x with argument 0x%p requested\n",
9903 + current->pid, fd, cmd, arg);
9915 + if ((ret = register_chrdev(SOCKSYS_MAJOR, "socksys", &socksys_fops))) {
9916 + printk(KERN_ERR "abi: unable register socksys char major\n");
9920 + fops_get(&socket_file_ops);
9921 + socksys_socket_fops = socket_file_ops;
9922 +#ifdef CONFIG_ABI_XTI
9923 + socksys_socket_fops.release = socksys_release;
9924 + socksys_socket_fops.poll = socksys_poll;
9932 + fops_put(&socket_file_ops);
9933 + unregister_chrdev(SOCKSYS_MAJOR, "socksys");
9936 +module_init(socksys_init);
9937 +module_exit(socksys_exit);
9939 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
9940 +EXPORT_SYMBOL(abi_ioctl_socksys);
9941 +EXPORT_SYMBOL(socksys_syscall);
9943 diff -Nru linux-2.6.7/abi/svr4/stat.c linux-2.6.7-abi/abi/svr4/stat.c
9944 --- linux-2.6.7/abi/svr4/stat.c 1970-01-01 01:00:00.000000000 +0100
9945 +++ linux-2.6.7-abi/abi/svr4/stat.c 2004-07-22 17:44:21.000000000 +0200
9948 + * Copyright (c) 2001 Caldera Deutschland GmbH.
9949 + * Copyright (c) 2001 Christoph Hellwig.
9950 + * All rights reserved.
9952 + * This program is free software; you can redistribute it and/or modify
9953 + * it under the terms of the GNU General Public License as published by
9954 + * the Free Software Foundation; either version 2 of the License, or
9955 + * (at your option) any later version.
9957 + * This program is distributed in the hope that it will be useful,
9958 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
9959 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9960 + * GNU General Public License for more details.
9962 + * You should have received a copy of the GNU General Public License
9963 + * along with this program; if not, write to the Free Software
9964 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
9970 + * SVR4 stat & friends support.
9972 +#include <linux/kernel.h>
9973 +#include <linux/fs.h>
9974 +#include <linux/sched.h>
9975 +#include <linux/file.h>
9976 +#include <linux/string.h>
9977 +#include <linux/module.h>
9978 +#include <asm/uaccess.h>
9980 +#include <abi/svr4/types.h>
9981 +#include <abi/svr4/stat.h>
9983 +#include <abi/util/stat.h>
9984 +#include <abi/util/trace.h>
9987 +enum {SVR4_stat = 1, SVR4_xstat = 2};
9990 +report_svr4_stat(struct kstat *stp, struct svr4_stat *bufp)
9992 + struct svr4_stat buf;
9994 + memset(&buf, 0, sizeof(struct svr4_stat));
9997 + buf.st_dev = linux_to_svr4_o_dev_t(stp->dev);
9998 + buf.st_ino = linux_to_svr4_o_ino_t(stp->ino);
9999 + buf.st_mode = stp->mode;
10000 + buf.st_nlink = stp->nlink;
10001 + buf.st_uid = linux_to_svr4_o_uid_t(stp->uid);
10002 + buf.st_gid = linux_to_svr4_o_gid_t(stp->gid);
10003 + buf.st_rdev = linux_to_svr4_o_dev_t(stp->rdev);
10005 + if (stp->size > MAX_NON_LFS)
10006 + return -EOVERFLOW; /* XXX: what to return for SVR4?? */
10008 + buf.st_size = stp->size;
10010 + buf.st_atime = stp->atime.tv_sec;
10011 + buf.st_mtime = stp->mtime.tv_sec;
10012 + buf.st_ctime = stp->ctime.tv_sec;
10014 + if (copy_to_user(bufp, &buf, sizeof(struct svr4_stat)))
10020 +report_svr4_xstat(struct kstat *stp, struct svr4_xstat *bufp)
10022 + struct svr4_xstat buf;
10024 + memset(&buf, 0, sizeof(struct svr4_xstat));
10027 + buf.st_dev = linux_to_svr4_dev_t(stp->dev);
10028 + buf.st_ino = linux_to_svr4_ino_t(stp->ino);
10029 + buf.st_mode = stp->mode;
10030 + buf.st_nlink = stp->nlink;
10031 + buf.st_uid = linux_to_svr4_uid_t(stp->uid);
10032 + buf.st_gid = linux_to_svr4_gid_t(stp->gid);
10033 + buf.st_rdev = linux_to_svr4_dev_t(stp->rdev);
10035 + if (stp->size > MAX_NON_LFS)
10036 + return -EOVERFLOW; /* XXX: what to return for SVR4?? */
10038 + buf.st_size = stp->size;
10040 + buf.st_atim.tv_sec = stp->atime.tv_sec;
10041 + buf.st_atim.tv_usec = stp->atime.tv_nsec / 1000;
10042 + buf.st_mtim.tv_sec = stp->mtime.tv_sec;
10043 + buf.st_mtim.tv_usec = stp->mtime.tv_nsec / 1000;
10044 + buf.st_ctim.tv_sec = stp->ctime.tv_sec;
10045 + buf.st_ctim.tv_usec = stp->ctime.tv_nsec / 1000;
10047 + buf.st_blksize = stp->blksize;
10048 + buf.st_blocks = stp->blocks;
10050 + if (copy_to_user(bufp, &buf, sizeof(struct svr4_xstat)))
10056 +svr4_stat(char *filename, struct svr4_stat *bufp)
10061 + error = vfs_stat(filename, &st);
10063 + error = report_svr4_stat(&st, bufp);
10068 +svr4_lstat(char *filename, struct svr4_stat *bufp)
10073 + error = vfs_lstat(filename, &st);
10075 + error = report_svr4_stat(&st, bufp);
10080 +svr4_fstat(int fd, struct svr4_stat *bufp)
10085 + error = vfs_fstat(fd, &st);
10087 + error = report_svr4_stat(&st, bufp);
10092 +svr4_xstat(int vers, char *filename, void *bufp)
10097 + error = vfs_stat(filename, &st);
10103 + return report_svr4_stat(&st, bufp);
10105 + return report_svr4_xstat(&st, bufp);
10108 +#if defined(CONFIG_ABI_TRACE)
10109 + abi_trace(ABI_TRACE_API, "xstat version %d not supported\n", vers);
10115 +svr4_lxstat(int vers, char *filename, void *bufp)
10120 + error = vfs_lstat(filename, &st);
10126 + return report_svr4_stat(&st, bufp);
10128 + return report_svr4_xstat(&st, bufp);
10131 +#if defined(CONFIG_ABI_TRACE)
10132 + abi_trace(ABI_TRACE_API, "lxstat version %d not supported\n", vers);
10138 +svr4_fxstat(int vers, int fd, void *bufp)
10143 + error = vfs_fstat(fd, &st);
10149 + return report_svr4_stat(&st, bufp);
10151 + return report_svr4_xstat(&st, bufp);
10154 +#if defined(CONFIG_ABI_TRACE)
10155 + abi_trace(ABI_TRACE_API, "fxstat version %d not supported\n", vers);
10160 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
10161 +EXPORT_SYMBOL(report_svr4_stat);
10162 +EXPORT_SYMBOL(report_svr4_xstat);
10163 +EXPORT_SYMBOL(svr4_fstat);
10164 +EXPORT_SYMBOL(svr4_fxstat);
10165 +EXPORT_SYMBOL(svr4_lstat);
10166 +EXPORT_SYMBOL(svr4_lxstat);
10167 +EXPORT_SYMBOL(svr4_stat);
10168 +EXPORT_SYMBOL(svr4_xstat);
10170 diff -Nru linux-2.6.7/abi/svr4/statvfs.c linux-2.6.7-abi/abi/svr4/statvfs.c
10171 --- linux-2.6.7/abi/svr4/statvfs.c 1970-01-01 01:00:00.000000000 +0100
10172 +++ linux-2.6.7-abi/abi/svr4/statvfs.c 2004-07-22 17:44:21.000000000 +0200
10175 + * Copyright (c) 2001 Caldera Deutschland GmbH.
10176 + * Copyright (c) 2001 Christoph Hellwig.
10177 + * All rights reserved.
10179 + * This program is free software; you can redistribute it and/or modify
10180 + * it under the terms of the GNU General Public License as published by
10181 + * the Free Software Foundation; either version 2 of the License, or
10182 + * (at your option) any later version.
10184 + * This program is distributed in the hope that it will be useful,
10185 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
10186 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10187 + * GNU General Public License for more details.
10189 + * You should have received a copy of the GNU General Public License
10190 + * along with this program; if not, write to the Free Software
10191 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
10197 + * SVR4 statvfs/fstatvfs support.
10199 +#include <linux/kernel.h>
10200 +#include <linux/fs.h>
10201 +#include <linux/statfs.h>
10202 +#include <linux/mount.h>
10203 +#include <linux/sched.h>
10204 +#include <linux/file.h>
10205 +#include <linux/string.h>
10206 +#include <linux/namei.h>
10207 +#include <linux/module.h>
10208 +#include <asm/uaccess.h>
10211 +struct svr4_statvfs {
10212 + u_int32_t f_bsize;
10213 + u_int32_t f_frsize;
10214 + u_int32_t f_blocks;
10215 + u_int32_t f_bfree;
10216 + u_int32_t f_bavail;
10217 + u_int32_t f_files;
10218 + u_int32_t f_free;
10220 + char f_basetype[16];
10221 + u_int32_t f_flag;
10222 + u_int32_t f_namemax;
10224 + u_int32_t f_filler[16];
10228 +report_statvfs(struct vfsmount *mnt, struct inode *ip, struct svr4_statvfs *bufp)
10230 + struct svr4_statvfs buf;
10231 + struct kstatfs s;
10234 + error = vfs_statfs(mnt->mnt_sb, &s);
10238 + memset(&buf, 0, sizeof(struct svr4_statvfs));
10240 + buf.f_bsize = s.f_bsize;
10241 + buf.f_frsize = s.f_bsize;
10242 + buf.f_blocks = s.f_blocks;
10243 + buf.f_bfree = s.f_bfree;
10244 + buf.f_bavail = s.f_bavail;
10245 + buf.f_files = s.f_files;
10246 + buf.f_free = s.f_ffree;
10247 + buf.f_sid = ip->i_sb->s_dev;
10249 + /* Get the name of the filesystem */
10250 + strcpy(buf.f_basetype, ip->i_sb->s_type->name);
10252 + /* Check for a few flags statvfs wants but statfs doesn't have. */
10253 + if (IS_RDONLY(ip))
10255 + if (mnt->mnt_flags & MNT_NOSUID)
10258 + buf.f_namemax = s.f_namelen;
10260 + if (copy_to_user(bufp, &buf, sizeof(struct svr4_statvfs)))
10266 +svr4_statvfs(char *filename, struct svr4_statvfs *bufp)
10268 + struct nameidata nd;
10271 + error = user_path_walk(filename, &nd);
10273 + error = report_statvfs(nd.mnt, nd.dentry->d_inode, bufp);
10274 + path_release(&nd);
10280 +svr4_fstatvfs(int fd, struct svr4_statvfs *bufp)
10283 + int error = -EBADF;
10287 + error = report_statvfs(fp->f_vfsmnt,
10288 + fp->f_dentry->d_inode, bufp);
10294 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
10295 +EXPORT_SYMBOL(svr4_statvfs);
10296 +EXPORT_SYMBOL(svr4_fstatvfs);
10298 diff -Nru linux-2.6.7/abi/svr4/stream.c linux-2.6.7-abi/abi/svr4/stream.c
10299 --- linux-2.6.7/abi/svr4/stream.c 1970-01-01 01:00:00.000000000 +0100
10300 +++ linux-2.6.7-abi/abi/svr4/stream.c 2004-07-22 17:44:21.000000000 +0200
10303 + * Copyright 1994,1995 Mike Jagdis (jaggy@purplet.demon.co.uk)
10308 +#include <linux/config.h>
10309 +#include <linux/errno.h>
10310 +#include <linux/ptrace.h>
10311 +#include <linux/sched.h>
10312 +#include <linux/file.h>
10313 +#include <linux/fs.h>
10314 +#include <linux/module.h>
10315 +#include <asm/uaccess.h>
10317 +#include <asm/abi_machdep.h>
10318 +#include <abi/tli.h>
10321 +#if !defined(CONFIG_ABI_XTI) && !defined(CONFIG_ABI_SPX)
10322 +# define timod_getmsg(fd, ino, is_pmsg, regs) 0
10323 +# define timod_putmsg(fd, ino, is_pmsg, regs) 0
10327 + * Check if the inode belongs to /dev/spx.
10329 +#define IS_SPX(ip) ((MAJOR((ip)->i_rdev) == 30 && MINOR((ip)->i_rdev) == 1))
10333 +svr4_getmsg(struct pt_regs *regs)
10336 + struct inode *ip;
10338 + int error = -EBADF;
10340 + fd = (int)get_syscall_parameter(regs, 0);
10343 + ip = fp->f_dentry->d_inode;
10345 + error = timod_getmsg(fd, ip, 0, regs);
10352 +svr4_putmsg(struct pt_regs *regs)
10355 + struct inode *ip;
10357 + int error = -EBADF;
10359 + fd = (int)get_syscall_parameter(regs, 0);
10362 + ip = fp->f_dentry->d_inode;
10363 + if (ip->i_sock || IS_SPX(ip))
10364 + error = timod_putmsg(fd, ip, 0, regs);
10370 +#ifdef CONFIG_ABI_XTI
10372 +svr4_getpmsg(struct pt_regs *regs)
10375 + struct inode *ip;
10377 + int error = -EBADF;
10379 + fd = (int)get_syscall_parameter(regs, 0);
10382 + ip = fp->f_dentry->d_inode;
10384 + error = timod_getmsg(fd, ip, 1, regs);
10391 +svr4_putpmsg(struct pt_regs *regs)
10394 + struct inode *ip;
10396 + int error = -EBADF;
10398 + fd = (int)get_syscall_parameter(regs, 0);
10401 + ip = fp->f_dentry->d_inode;
10402 + if (ip->i_sock || IS_SPX(ip))
10403 + error = timod_putmsg(fd, ip, 1, regs);
10408 +#endif /* CONFIG_ABI_XTI */
10410 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
10411 +EXPORT_SYMBOL(svr4_getmsg);
10412 +EXPORT_SYMBOL(svr4_getpmsg);
10413 +EXPORT_SYMBOL(svr4_putmsg);
10414 +EXPORT_SYMBOL(svr4_putpmsg);
10416 diff -Nru linux-2.6.7/abi/svr4/svr4.c linux-2.6.7-abi/abi/svr4/svr4.c
10417 --- linux-2.6.7/abi/svr4/svr4.c 1970-01-01 01:00:00.000000000 +0100
10418 +++ linux-2.6.7-abi/abi/svr4/svr4.c 2004-07-22 17:44:21.000000000 +0200
10421 + * Copyright (C) 1995 Mike Jagdis
10426 +#include <linux/types.h>
10427 +#include <linux/errno.h>
10428 +#include <linux/sched.h>
10429 +#include <linux/kernel.h>
10430 +#include <linux/mm.h>
10431 +#include <linux/stddef.h>
10432 +#include <linux/unistd.h>
10433 +#include <linux/ptrace.h>
10434 +#include <linux/fcntl.h>
10435 +#include <linux/time.h>
10436 +#include <linux/fs.h>
10437 +#include <linux/statfs.h>
10438 +#include <linux/sys.h>
10439 +#include <linux/slab.h>
10440 +#include <linux/personality.h>
10441 +#include <linux/syscalls.h>
10442 +#include <linux/module.h>
10443 +#include <asm/uaccess.h>
10445 +#include <asm/abi_machdep.h>
10446 +#include <abi/svr4/sigset.h>
10447 +#include <abi/svr4/siginfo.h>
10449 +#include <abi/util/trace.h>
10453 + * Interactive SVR4's /bin/sh calls access(... 011) but Linux returns
10454 + * EINVAL if the access mode has any other bits than 007 set.
10458 +svr4_access(char *path, int mode)
10460 + return sys_access(path, mode & 007);
10465 + SVR4_CLD_EXITED = 1,
10466 + SVR4_CLD_KILLED = 2,
10467 + SVR4_CLD_DUMPED = 3,
10468 + SVR4_CLD_TRAPPED = 4,
10469 + SVR4_CLD_STOPPED = 5,
10470 + SVR4_CLD_CONTINUED = 6
10474 +svr4_waitid(int idtype, int id, struct svr4_siginfo *infop, int options)
10476 + long result, kopt;
10477 + mm_segment_t old_fs;
10480 + switch (idtype) {
10481 + case 0: /* P_PID */
10485 + case 1: /* P_PGID */
10489 + case 7: /* P_ALL */
10498 + result = verify_area(VERIFY_WRITE, infop,
10499 + sizeof(struct svr4_siginfo));
10505 + if (options & 0100) kopt |= WNOHANG;
10506 + if (options & 4) kopt |= WUNTRACED;
10508 + old_fs = get_fs();
10509 + set_fs(get_ds());
10510 + result = sys_wait4(pid, &status, kopt, NULL);
10516 + unsigned long op, st;
10518 + put_user(current_thread_info()->exec_domain->signal_map[SIGCHLD],
10519 + &infop->si_signo);
10521 + &infop->_data._proc._pid);
10523 + if ((status & 0xff) == 0) {
10524 + /* Normal exit. */
10525 + op = SVR4_CLD_EXITED;
10526 + st = status >> 8;
10527 + } else if ((status & 0xff) == 0x7f) {
10529 + st = (status & 0xff00) >> 8;
10530 + op = (st == SIGSTOP || st == SIGTSTP)
10531 + ? SVR4_CLD_STOPPED
10532 + : SVR4_CLD_CONTINUED;
10533 + st = current_thread_info()->exec_domain->signal_invmap[st];
10535 + st = (status & 0xff00) >> 8;
10536 + op = (status & 0200)
10537 + ? SVR4_CLD_DUMPED
10538 + : SVR4_CLD_KILLED;
10539 + st = current_thread_info()->exec_domain->signal_invmap[st];
10541 + put_user(op, &infop->si_code);
10542 + put_user(st, &infop->_data._proc._pdata._cld._status);
10548 +svr4_seteuid(int uid)
10550 + return sys_setreuid16(-1, uid);
10554 +svr4_setegid(int gid)
10556 + return sys_setregid16(-1, gid);
10559 +/* POSIX.1 names */
10560 +#define _PC_LINK_MAX 1
10561 +#define _PC_MAX_CANON 2
10562 +#define _PC_MAX_INPUT 3
10563 +#define _PC_NAME_MAX 4
10564 +#define _PC_PATH_MAX 5
10565 +#define _PC_PIPE_BUF 6
10566 +#define _PC_NO_TRUNC 7
10567 +#define _PC_VDISABLE 8
10568 +#define _PC_CHOWN_RESTRICTED 9
10569 +/* POSIX.4 names */
10570 +#define _PC_ASYNC_IO 10
10571 +#define _PC_PRIO_IO 11
10572 +#define _PC_SYNC_IO 12
10575 +svr4_pathconf(char *path, int name)
10578 + case _PC_LINK_MAX:
10579 + /* Although Linux headers define values on a per
10580 + * filesystem basis there is no way to access
10581 + * these without hard coding fs information here
10582 + * so for now we use a bogus value.
10586 + case _PC_MAX_CANON:
10587 + return MAX_CANON;
10589 + case _PC_MAX_INPUT:
10590 + return MAX_INPUT;
10592 + case _PC_PATH_MAX:
10595 + case _PC_PIPE_BUF:
10598 + case _PC_CHOWN_RESTRICTED:
10599 + /* We should really think about this and tell
10604 + case _PC_NO_TRUNC:
10605 + /* Not sure... It could be fs dependent? */
10608 + case _PC_VDISABLE:
10611 + case _PC_NAME_MAX: {
10612 + struct statfs buf;
10615 + mm_segment_t old_fs;
10617 + p = getname(path);
10618 + error = PTR_ERR(p);
10619 + if (!IS_ERR(p)) {
10620 + old_fs = get_fs();
10621 + set_fs (get_ds());
10622 + error = sys_statfs(p, &buf);
10626 + return buf.f_namelen;
10636 +svr4_fpathconf(int fildes, int name)
10639 + case _PC_LINK_MAX:
10640 + /* Although Linux headers define values on a per
10641 + * filesystem basis there is no way to access
10642 + * these without hard coding fs information here
10643 + * so for now we use a bogus value.
10647 + case _PC_MAX_CANON:
10648 + return MAX_CANON;
10650 + case _PC_MAX_INPUT:
10651 + return MAX_INPUT;
10653 + case _PC_PATH_MAX:
10656 + case _PC_PIPE_BUF:
10659 + case _PC_CHOWN_RESTRICTED:
10660 + /* We should really think about this and tell
10665 + case _PC_NO_TRUNC:
10666 + /* Not sure... It could be fs dependent? */
10669 + case _PC_VDISABLE:
10672 + case _PC_NAME_MAX: {
10673 + struct statfs buf;
10675 + mm_segment_t old_fs;
10677 + old_fs = get_fs();
10678 + set_fs (get_ds());
10679 + error = sys_fstatfs(fildes, &buf);
10682 + return buf.f_namelen;
10691 +svr4_sigpending(int which_routine, svr4_sigset_t *set)
10693 + /* Solaris multiplexes on this one */
10694 + /* Which routine has the actual routine that should be called */
10696 + switch (which_routine){
10697 + case 1: /* sigpending */
10698 + printk ("iBCS/Intel: sigpending not implemented\n");
10701 + case 2: /* sigfillset */
10702 + set->setbits [0] = ~0;
10703 + set->setbits [1] = 0;
10704 + set->setbits [2] = 0;
10705 + set->setbits [3] = 0;
10711 +typedef void svr4_ucontext_t;
10714 +svr4_setcontext(svr4_ucontext_t *c, struct pt_regs *regs)
10716 + printk (KERN_DEBUG "Getting context\n");
10721 +svr4_getcontext(svr4_ucontext_t *c, struct pt_regs *regs)
10723 + printk (KERN_DEBUG "Setting context\n");
10728 +svr4_context(struct pt_regs *regs)
10730 + int context_fn = get_syscall_parameter (regs, 0);
10731 + struct svr4_ucontext_t *uc = (void *) get_syscall_parameter (regs, 1);
10733 + switch (context_fn){
10734 + case 0: /* getcontext */
10735 + return svr4_getcontext (uc, regs);
10737 + case 1: /* setcontext */
10738 + return svr4_setcontext (uc, regs);
10743 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
10744 +EXPORT_SYMBOL(svr4_context);
10745 +EXPORT_SYMBOL(svr4_fpathconf);
10746 +EXPORT_SYMBOL(svr4_pathconf);
10747 +EXPORT_SYMBOL(svr4_setegid);
10748 +EXPORT_SYMBOL(svr4_seteuid);
10749 +EXPORT_SYMBOL(svr4_sigpending);
10750 +EXPORT_SYMBOL(svr4_waitid);
10752 diff -Nru linux-2.6.7/abi/svr4/sysconf.c linux-2.6.7-abi/abi/svr4/sysconf.c
10753 --- linux-2.6.7/abi/svr4/sysconf.c 1970-01-01 01:00:00.000000000 +0100
10754 +++ linux-2.6.7-abi/abi/svr4/sysconf.c 2004-07-22 17:44:21.000000000 +0200
10757 + * sysconf.c - sysv sysconf(2) and sysconfig(2) emulation
10759 + * Copyright (C) 1994 Mike Jagdis (jaggy@purplet.demon.co.uk)
10764 +#include <linux/module.h>
10765 +#include <linux/errno.h>
10766 +#include <linux/sched.h>
10767 +#include <linux/kernel.h>
10768 +#include <linux/mm.h>
10769 +#include <linux/stddef.h>
10770 +#include <linux/limits.h>
10771 +#include <linux/unistd.h>
10772 +#include <linux/ptrace.h>
10773 +#include <linux/fcntl.h>
10774 +#include <linux/smp.h>
10775 +#include <linux/swap.h>
10776 +#include <linux/fs.h>
10777 +#include <linux/sys.h>
10778 +#include <asm/uaccess.h>
10779 +#include <asm/system.h>
10781 +#include <abi/svr4/sysconf.h>
10782 +#include <abi/util/trace.h>
10785 +/* The sysconf() call is supposed to give applications access to various
10786 + * kernel parameters. According to SCO's man page this a POSIX mandated
10787 + * function. Perhaps it should be moved across as a native Linux call?
10789 + * N.B. SCO only has sysconf in the Xenix group. Therefore this is based
10790 + * on the Xenix spec. Is SVR4 the same? Wyse Unix V.3.2.1A doesn't have
10791 + * sysconf documented at all.
10793 + * N.B. 0-7 are required (by who?). Other values may be defined for
10794 + * various systems but there appears no guarantee that they match across
10795 + * platforms. Thus, unless we can identify what system the executable
10796 + * was compiled for, we probably prefer to have extensions fail. Hell,
10797 + * nothing important is going to use this obscure stuff anyway...
10799 +#define _SC_ARG_MAX 0
10800 +#define _SC_CHILD_MAX 1
10801 +#define _SC_CLK_TCK 2
10802 +#define _SC_NGROUPS_MAX 3
10803 +#define _SC_OPEN_MAX 4
10804 +#define _SC_JOB_CONTROL 5
10805 +#define _SC_SAVED_IDS 6
10806 +#define _SC_VERSION 7
10808 +#define _SC_PAGESIZE 11
10809 +#define _SCO_SC_PAGESIZE 34
10812 +/* This is an SVR4 system call that is undocumented except for some
10813 + * hints in a header file. It appears to be a forerunner to the
10814 + * POSIX sysconf() call.
10816 +int svr4_sysconfig(int name)
10819 + case _CONFIG_NGROUPS:
10820 + /* From limits.h */
10821 + return (NGROUPS_MAX);
10823 + case _CONFIG_CHILD_MAX:
10824 + /* From limits.h */
10825 + return (CHILD_MAX);
10827 + case _CONFIG_OPEN_FILES:
10828 + /* From limits.h */
10829 + return (OPEN_MAX);
10831 + case _CONFIG_POSIX_VER:
10832 + /* The version of the POSIX standard we conform
10833 + * to. SCO defines _POSIX_VERSION as 198808L
10834 + * sys/unistd.h. What are we? We are 199009L.
10836 + return (199009L);
10838 + case _CONFIG_PAGESIZE:
10839 + return (PAGE_SIZE);
10841 + case _CONFIG_CLK_TCK:
10844 + case _CONFIG_XOPEN_VER:
10847 + case _CONFIG_NACLS_MAX:
10850 + case _CONFIG_NPROC:
10851 + return 4000; /* max_threads */
10853 + case _CONFIG_NENGINE:
10854 + case _CONFIG_NENGINE_ONLN:
10855 + return (num_online_cpus());
10857 + case _CONFIG_TOTAL_MEMORY:
10858 + return (max_mapnr << (PAGE_SHIFT-10));
10860 + case _CONFIG_USEABLE_MEMORY:
10861 + case _CONFIG_GENERAL_MEMORY:
10862 + return (max_mapnr << (PAGE_SHIFT-10));
10863 +/* return ((unsigned long) (nr_free_pages()) << (PAGE_SHIFT-10)); */
10865 + case _CONFIG_DEDICATED_MEMORY:
10868 + case _CONFIG_NCGS_CONF:
10869 + case _CONFIG_NCGS_ONLN:
10870 + case _CONFIG_MAX_ENG_PER_CG:
10871 + return 1; /* no NUMA-Q support on Linux yet */
10872 + /* well, there is. we lie anyway --hch */
10874 + case _CONFIG_CACHE_LINE:
10875 + return 32; /* XXX is there a more accurate way? */
10877 + case _CONFIG_KERNEL_VM:
10880 + case _CONFIG_ARG_MAX:
10881 + /* From limits.h */
10882 + return (ARG_MAX);
10885 +#if defined(CONFIG_ABI_TRACE)
10886 + abi_trace(ABI_TRACE_API, "unsupported sysconfig call %d\n", name);
10892 +int ibcs_sysconf(int name)
10895 + case _SC_ARG_MAX:
10896 + /* From limits.h */
10897 + return (ARG_MAX);
10899 + case _SC_CHILD_MAX:
10900 + /* From limits.h */
10901 + return (CHILD_MAX);
10903 + case _SC_CLK_TCK:
10906 + case _SC_NGROUPS_MAX:
10907 + /* From limits.h */
10908 + return (NGROUPS_MAX);
10910 + case _SC_OPEN_MAX:
10911 + /* From limits.h */
10912 + return (OPEN_MAX);
10914 + case _SC_JOB_CONTROL:
10917 + case _SC_SAVED_IDS:
10920 + case _SC_PAGESIZE:
10921 + case _SCO_SC_PAGESIZE:
10922 + return PAGE_SIZE;
10924 + case _SC_VERSION:
10925 + /* The version of the POSIX standard we conform
10926 + * to. SCO defines _POSIX_VERSION as 198808L
10927 + * sys/unistd.h. What are we?
10929 + return (198808L);
10932 +#if defined(CONFIG_ABI_TRACE)
10933 + abi_trace(ABI_TRACE_API, "unsupported sysconf call %d\n", name);
10938 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
10939 +EXPORT_SYMBOL(ibcs_sysconf);
10940 +EXPORT_SYMBOL(svr4_sysconfig);
10942 diff -Nru linux-2.6.7/abi/svr4/sysfs.c linux-2.6.7-abi/abi/svr4/sysfs.c
10943 --- linux-2.6.7/abi/svr4/sysfs.c 1970-01-01 01:00:00.000000000 +0100
10944 +++ linux-2.6.7-abi/abi/svr4/sysfs.c 2004-07-22 17:44:21.000000000 +0200
10947 + * Copyright (C) 1994 Mike Jagdis (jaggy@purplet.demon.co.uk)
10952 +#include <linux/module.h>
10953 +#include <linux/personality.h>
10954 +#include <linux/sched.h>
10955 +#include <linux/syscalls.h>
10956 +#include <asm/uaccess.h>
10958 +#include <abi/util/trace.h>
10961 + * The kernel sysfs() code is almost all we need but, apparently,
10962 + * the SCO (at least) sysfs() will also accept a "magic number"
10963 + * as an index argument and will return the name of the relevant
10964 + * file system. Since Linux doesn't have any concept of fs magic
10965 + * numbers outside the file system code themselves there is no
10966 + * clean way to do it in the kernel. There isn't a clean way to
10967 + * to it here either but it needs to be done somehow :-(.
10976 +svr4_sysfs(int cmd, int arg1, int arg2)
10978 + if (cmd == GETFSIND)
10979 + return sys_sysfs(cmd, arg1, arg2);
10981 + if (cmd == GETNFSTYP)
10982 + return sys_sysfs(cmd, arg1, arg2);
10984 + if (cmd == GETFSTYP) {
10985 + char *buf = (char *)arg2;
10988 + if (arg1 & 0x80000000)
10989 + arg1 &= 0x0000ffff;
10990 + if (arg1 >= 0 && arg1 < sys_sysfs(GETNFSTYP,0,0))
10991 + return sys_sysfs(cmd, arg1-1, arg2);
10994 + * Kludge alert! Hardcoded known magic numbers!
10997 + case 0xef53: case 0xffffef53:
10998 + case 0xef51: case 0xffffef51:
11000 + * Some SCO programs (i.e. Informix Dynamic
11001 + * Server are using this to detect "real"
11002 + * filesystems by checking type names :-(.
11005 + if (is_cur_personality(PER_SCOSVR3))
11006 + error = copy_to_user(buf, "HTFS", 5);
11008 + error = copy_to_user(buf, "ext2", 5);
11011 + error = copy_to_user(buf, "ext", 4);
11013 + case 0x9660: case 0xffff9660:
11014 + error = copy_to_user(buf, "iso9660", 8);
11017 + error = copy_to_user(buf, "msdos", 6);
11020 + error = copy_to_user(buf, "nfs", 4);
11022 + case 0x9fa0: case 0xffff9fa0:
11023 + error = copy_to_user(buf, "proc", 5);
11026 + case 0xe849: case 0xffffe849:
11027 + error = copy_to_user(buf, "hpfs", 5);
11029 + case 0x137f: /* original */
11030 + case 0x138f: /* original + 30 char names */
11031 + case 0x2468: /* V2 */
11032 + case 0x2478: /* V2 + 30 char names */
11033 + error = copy_to_user(buf, "minix", 6);
11036 + error = copy_to_user(buf, "ncpfs", 6);
11039 + error = copy_to_user(buf, "smbfs", 6);
11042 + error = copy_to_user(buf, "ufs", 4);
11044 + case 0x012fd16d: case 0xffffd16d:
11045 + error = copy_to_user(buf, "xiafs", 6);
11047 + case 0x012ff7b3+1: case 0xfffff7b3+1:
11048 + error = copy_to_user(buf, "xenix", 6);
11050 + case 0x012ff7b3+2: case 0xfffff7b3+2:
11051 + case 0x012ff7b3+3: case 0xfffff7b3+3:
11052 + error = copy_to_user(buf, "sysv", 5);
11054 + case 0x012ff7b3+4: case 0xfffff7b3+4:
11055 + error = copy_to_user(buf, "coherent", 9);
11058 + error = copy_to_user(buf, "", 1);
11067 +#if defined(CONFIG_ABI_TRACE)
11068 + abi_trace(ABI_TRACE_API, "unsupported sysfs call %d\n", cmd);
11073 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
11074 +EXPORT_SYMBOL(svr4_sysfs);
11076 diff -Nru linux-2.6.7/abi/svr4/sysi86.c linux-2.6.7-abi/abi/svr4/sysi86.c
11077 --- linux-2.6.7/abi/svr4/sysi86.c 1970-01-01 01:00:00.000000000 +0100
11078 +++ linux-2.6.7-abi/abi/svr4/sysi86.c 2004-07-22 17:44:21.000000000 +0200
11081 + * Copyright 1994,1995 Mike Jagdis <jaggy@purplet.demon.co.uk>
11082 + * Copyright 2002 Caldera Deutschland GmbH
11087 +#include <linux/sched.h>
11088 +#include <linux/kernel.h>
11089 +#include <linux/ptrace.h>
11090 +#include <linux/syscalls.h>
11091 +#include <linux/mm.h>
11092 +#include <linux/module.h>
11093 +#include <asm/uaccess.h>
11095 +#include <abi/util/trace.h>
11099 + * The sysi86() call is used for machine specific functions. Only the
11100 + * most basic are implemented here.
11102 +#define SI86SWPI 1 /* General swap functions. */
11103 +#define SI86SYM 2 /* Get symbol table */
11104 +#define SI86CONF 4 /* Get configuration table */
11105 +#define SI86BOOT 5 /* Get timestamp and name of program
11108 +#define SI86DMM 7 /* Double-map data segment for
11109 + * read/write/execute support
11111 +#define SI86AUTO 9 /* Was an auto-config boot done? */
11112 +#define SI86EDT 10 /* Copy contents of EDT to user */
11113 +#define SI86SWAP 12 /* Declare swap space */
11114 +#define SI86FPHW 40 /* what (if any?) floating-point hardware */
11115 +# define FP_NO 0 /* No fp at all */
11116 +# define FP_SW 1 /* using emulator */
11117 +# define FP_HW 2 /* using hardware */
11118 +# define FP_287 2 /* using a 287 */
11119 +# define FP_387 3 /* using a 387 */
11120 +#define GRNON 52 /* set green light to solid on state */
11121 +#define GRNFLASH 53 /* start green light flashing */
11122 +#define STIME 54 /* set internal time */
11123 +#define SETNAME 56 /* rename the system */
11124 +#define RNVR 58 /* read NVRAM */
11125 +#define WNVR 59 /* write NVRAM */
11126 +#define RTODC 60 /* read time of day clock */
11127 +#define CHKSER 61 /* check soft serial number */
11128 +#define SI86NVPRT 62 /* print an xtra_nvr structure */
11129 +#define SANUPD 63 /* sanity update of kernel buffers */
11130 +#define SI86KSTR 64 /* make a copy of a kernel string */
11131 +#define SI86MEM 65 /* return the memory size of system */
11132 +#define SI86TODEMON 66 /* Transfer control to firmware. */
11133 +#define SI86CCDEMON 67 /* Control character access to demon. */
11134 +#define SI86CACHE 68 /* Turn cache on and off. */
11135 +#define SI86DELMEM 69 /* Delete available memory for testing. */
11136 +#define SI86ADDMEM 70 /* Add back deleted memory. */
11137 +/* 71 through 74 reserved for VPIX */
11138 +#define SI86V86 71 /* V86 system calls (see v86.h) */
11139 +#define SI86SLTIME 72 /* Set local time correction */
11140 +#define SI86DSCR 75 /* Set a segment or gate descriptor */
11141 +#define RDUBLK 76 /* Read U Block */
11142 +/* #ifdef MERGE386 */
11143 +/* NFA entry point */
11144 +#define SI86NFA 77 /* make nfa_sys system call */
11145 +#define SI86VM86 81
11146 +#define SI86VMENABLE 82
11147 +/* #endif MERGE386 */
11148 +#define SI86VM86 81
11149 +#define SI86VMENABLE 82
11150 +#define SI86LIMUSER 91 /* liscense interface */
11151 +#define SI86RDID 92 /* ROM BIOS Machid ID */
11152 +#define SI86RDBOOT 93 /* Bootable Non-SCSI Hard Disk */
11153 +/* Merged Product defines */
11154 +#define SI86SHFIL 100 /* map a file into addr space of a proc */
11155 +#define SI86PCHRGN 101 /* make globally visible change to a region */
11156 +#define SI86BADVISE 102 /* badvise subcommand - see below for */
11157 + /* badvise subfunction definitions */
11158 +#define SI86SHRGN 103 /* enable/disable XENIX small model shared */
11159 + /* data context switching */
11160 +#define SI86CHIDT 104 /* set user level int 0xf0, ... 0xff handlers */
11161 +#define SI86EMULRDA 105 /* remove special emulator read access */
11162 +#define SI86GETPIPE 106 /* return the pipe filesystem */
11163 +#define SI86SETPIPE 107 /* set the pipe filesystem */
11164 +#define SI86SETPIPE_NM 108 /* set the pipe filesystem -non mountable */
11165 +#define SI86GETNPIPE 109 /* get # of pipe filesystems */
11166 +#define SI86GETPIPE_ALL 110 /* get data on all of pipe filesystems */
11167 +#define SI86POPPIPE 111 /* pop pipe file system off stack */
11168 +#define SI86APM 112 /* get APM information passed by boot(HW) */
11169 +#define SI86TIMECHG 113 /* get time before/after last timechange */
11170 +#define SI86GETFEATURES 114 /* get os features vector */
11172 +/* The SI86BADVISE command is used to set Xenix behaviour. */
11173 +#define SI86B_SET 0x0100 /* Set badvise bits */
11174 +#define SI86B_GET 0x0200 /* Get badvise bits */
11175 +#define SI86B_LOCK 0x0001 /* XENIX advisory locking bit */
11176 +#define SI86B_PRE_SV 0x0008 /* follow pre-System V x.out behavior */
11177 +#define SI86B_XOUT 0x0010 /* follow XENIX x.out behavior */
11178 +#define SI86B_XSDSWTCH 0x0080 /* XENIX small model shared data */
11179 + /* context switching enabled */
11182 + * The SI86DSCR subcommand of the sysi86() system call
11183 + * sets a segment or gate descriptor in the kernel.
11184 + * The following descriptor types are accepted:
11185 + * - executable and data segments in the LDT at DPL 3
11186 + * - a call gate in the GDT at DPL 3 that points to a segment in the LDT
11187 + * The request structure declared below is used to pass the values
11188 + * to be placed in the descriptor. A pointer to the structure is
11189 + * passed as the second argument of the system call.
11190 + * If acc1 is zero, the descriptor is cleared.
11193 + uint32_t sel; /* descriptor selector */
11194 + uint32_t bo; /* segment base or gate offset */
11195 + uint32_t ls; /* segment limit or gate selector */
11196 + uint32_t acc1; /* access byte 5 */
11197 + uint32_t acc2; /* access bits in byte 6 or gate count */
11202 +svr4_sysi86(int cmd, void *arg1, int arg2)
11207 + * If we remove the 'static' from the definition
11208 + * of fpu_error in linux/init/main.c we can tell
11209 + * whether we are using hardware or software at
11210 + * least. For now let's lie...
11211 + * (actually SCO Unix 3.4 gives me -1...)
11213 + return put_user(FP_387, (unsigned long *)arg1);
11216 + * Set the system time. The argument is a long,
11217 + * sys_stime() expects a pointer to a long...
11219 + return sys_stime(arg1);
11222 + * The name is required to be string of no more
11223 + * than 7 characters. We don't get passed the
11224 + * length so we are depending upon the current
11225 + * implementation of sys_sethostname() here.
11227 + return sys_sethostname(arg1, 7);
11231 + * Returns the size of physical memory.
11233 + struct sysinfo i;
11236 + return (i.totalram << PAGE_SHIFT);
11242 + if (copy_from_user(&s, arg1, sizeof(struct ssd)))
11245 + printk("SI86DSCR(%x,%x,%x,%x,%x)\n",
11246 + s.sel, s.bo, s.ls, s.acc1, s.acc2);
11250 +#if defined(CONFIG_ABI_TRACE)
11251 + abi_trace(ABI_TRACE_API, "unsupported sysi86 subcall %d\n", cmd);
11257 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
11258 +EXPORT_SYMBOL(svr4_sysi86);
11260 diff -Nru linux-2.6.7/abi/svr4/sysinfo.c linux-2.6.7-abi/abi/svr4/sysinfo.c
11261 --- linux-2.6.7/abi/svr4/sysinfo.c 1970-01-01 01:00:00.000000000 +0100
11262 +++ linux-2.6.7-abi/abi/svr4/sysinfo.c 2004-07-22 17:44:21.000000000 +0200
11265 + * Copyright (C) 1995 Eric Youngdale
11270 +#include <linux/module.h>
11271 +#include <linux/version.h>
11272 +#include <linux/compile.h>
11273 +#include <linux/mm.h>
11274 +#include <linux/errno.h>
11275 +#include <linux/sched.h>
11276 +#include <linux/utsname.h>
11277 +#include <asm/uaccess.h>
11279 +#include <abi/util/trace.h>
11282 +#define __O_SI_SYSNAME 1 /* return name of operating system */
11283 +#define __O_SI_HOSTNAME 2 /* return name of node */
11284 +#define SI_RELEASE 3 /* return release of operating system */
11285 +#define SI_VERSION 4 /* return version field of utsname */
11286 +#define __O_SI_MACHINE 5 /* return kind of machine */
11287 +#define __O_SI_ARCHITECTURE 6 /* return instruction set arch */
11288 +#define SI_HW_SERIAL 7 /* return hardware serial number */
11289 +#define __O_SI_HW_PROVIDER 8 /* return hardware manufacturer */
11290 +#define SI_SRPC_DOMAIN 9 /* return secure RPC domain */
11291 +#define SI_INITTAB_NAME 10 /* return name of inittab file used */
11292 +#define SI_ARCHITECTURE 100 /* return instruction set arch */
11293 +#define SI_BUSTYPES 101 /* return list of bus types */
11294 +#define SI_HOSTNAME 102 /* return fully-qualified node name */
11295 +#define SI_HW_PROVIDER 103 /* return hardware manufacturer */
11296 +#define SI_KERNEL_STAMP 104 /* return kernel generation timestamp */
11297 +#define SI_MACHINE 105 /* return kind of machine */
11298 +#define SI_OS_BASE 106 /* return base operating system */
11299 +#define SI_OS_PROVIDER 107 /* return operating system provider */
11300 +#define SI_SYSNAME 108 /* return name of operating system */
11301 +#define SI_USER_LIMIT 109 /* return maximum number of users */
11305 +int svr4_sysinfo(int cmd, char * buf, long count)
11307 + char * return_string;
11308 + static unsigned int serial_number = 0;
11313 + return_string = NULL;
11316 + case __O_SI_SYSNAME:
11318 + return_string = system_utsname.sysname;
11320 + case __O_SI_HOSTNAME:
11321 + case SI_HOSTNAME:
11322 + return_string = system_utsname.nodename;
11325 + return_string = "2";
11328 + return_string = system_utsname.release;
11331 + case __O_SI_MACHINE:
11332 + return_string = system_utsname.machine;
11334 + case __O_SI_ARCHITECTURE:
11335 + case SI_ARCHITECTURE:
11336 + return_string = "IA32"; /* XXX: this seems wrong, the name ia32 is very new ... -- ch */
11338 + case SI_BUSTYPES:
11339 + return_string = "PCI ISA";
11341 + case __O_SI_HW_PROVIDER:
11342 + case SI_HW_PROVIDER:
11343 + return_string = "Generic AT";
11345 + case SI_KERNEL_STAMP:
11346 + return_string = UTS_VERSION;
11348 + case SI_INITTAB_NAME:
11349 + return_string = "/etc/inittab";
11351 + case SI_HW_SERIAL:
11352 + if(serial_number == 0)
11353 + serial_number = 0xdeadbeef;
11354 + sprintf(buffer,"%8.8x", serial_number);
11355 + return_string = buffer;
11358 + return_string = "Linux";
11360 + case SI_OS_PROVIDER:
11361 + return_string = "LBT"; /* someone's initials ? */
11363 + case SI_SRPC_DOMAIN:
11364 + return_string = system_utsname.domainname;
11366 + case SI_USER_LIMIT:
11367 + /* have you seen a Linux box with more than 500000 users? */
11368 + return_string = "500000";
11371 +#if defined(CONFIG_ABI_TRACE)
11372 + abi_trace(ABI_TRACE_API,
11373 + "unsupported sysinfo call %d\n", cmd);
11378 + if (!return_string)
11381 + down_read(&uts_sem);
11382 + slen = (count < strlen(return_string) + 1 ? count : strlen(return_string) + 1);
11383 + error = copy_to_user(buf, return_string, slen);
11384 + up_read(&uts_sem);
11386 + return error ? -EFAULT : slen;
11389 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
11390 +EXPORT_SYMBOL(svr4_sysinfo);
11392 diff -Nru linux-2.6.7/abi/svr4/tapeio.c linux-2.6.7-abi/abi/svr4/tapeio.c
11393 --- linux-2.6.7/abi/svr4/tapeio.c 1970-01-01 01:00:00.000000000 +0100
11394 +++ linux-2.6.7-abi/abi/svr4/tapeio.c 2004-07-22 17:44:21.000000000 +0200
11398 +#include <linux/errno.h>
11399 +#include <linux/kernel.h>
11400 +#include <linux/mtio.h>
11401 +#include <linux/syscalls.h>
11402 +#include <asm/uaccess.h>
11406 +svr4_tape_ioctl(int fd, u_int cmd, caddr_t data)
11410 + struct mtop mtop;
11412 + mtop.mt_count = 1;
11414 + switch (cmd & 0xff) {
11415 + case 1: /* MT_RETEN */
11416 + mtop.mt_op = MTRETEN;
11418 + case 2: /* MT_REWIND */
11419 + mtop.mt_op = MTREW;
11421 + case 3: /* MT_ERASE */
11422 + mtop.mt_op = MTERASE;
11424 + case 4: /* MT_WFM */
11425 + mtop.mt_op = MTWEOF;
11427 + case 5: /* MT_RESET */
11428 + mtop.mt_op = MTRESET;
11430 + case 7: /* T_SFF */
11431 + mtop.mt_op = MTFSF;
11433 + case 8: /* T_SBF */
11434 + mtop.mt_op = MTBSF;
11436 + case 9: /* T_LOAD */
11437 + mtop.mt_op = MTLOAD;
11439 + case 10: /* MT_UNLOAD */
11440 + mtop.mt_op = MTOFFL;
11442 + case 15: /* T_WRBLKLEN */
11443 + mtop.mt_op = MTLOCK;
11444 + mtop.mt_count = (int)data;
11446 + case 16: /* T_PREVMV */
11447 + mtop.mt_op = MTLOCK;
11449 + case 17: /* T_ALLOMV */
11450 + mtop.mt_op = MTUNLOCK;
11452 + case 20: /* T_EOD */
11453 + mtop.mt_op = MTEOM;
11454 + mtop.mt_count = (int)data;
11456 + case 21: /* T_SSFB */
11457 + mtop.mt_op = MTBSFM;
11458 + mtop.mt_count = (int)data;
11460 + case 22: /* T_SSFF */
11461 + mtop.mt_op = MTFSFM;
11462 + mtop.mt_count = (int)data;
11464 + case 24: /* T_STD */
11465 + mtop.mt_op = MTSETDENSITY;
11466 + mtop.mt_count = (int)data;
11470 + case 6: /* T_STATUS */
11471 + case 14: /* T_RDBLKLEN */
11472 + case 18: /* T_SBB */
11473 + case 19: /* T_SFB */
11474 + case 23: /* T_STS */
11477 + printk (KERN_ERR "iBCS: SYSV tape ioctl func=%d arg=%x unsupported\n",
11478 + cmd & 0xff, (int)data);
11483 + set_fs(get_ds());
11484 + error = sys_ioctl(fd, MTIOCTOP, (long)&mtop);
11488 diff -Nru linux-2.6.7/abi/svr4/termios.c linux-2.6.7-abi/abi/svr4/termios.c
11489 --- linux-2.6.7/abi/svr4/termios.c 1970-01-01 01:00:00.000000000 +0100
11490 +++ linux-2.6.7-abi/abi/svr4/termios.c 2004-07-22 17:44:21.000000000 +0200
11494 +#include <linux/kernel.h>
11495 +#include <linux/unistd.h>
11496 +#include <linux/termios.h>
11497 +#include <linux/syscalls.h>
11498 +#include <asm/uaccess.h>
11500 +#include <abi/svr4/ioctl.h>
11501 +#include <abi/svr4/termios.h>
11505 +svr_to_linux_termio(int fd, int op, struct svr_termio *it)
11513 + error = verify_area(VERIFY_READ, it, sizeof(struct svr_termio));
11518 + set_fs(get_ds());
11519 + error = sys_ioctl(fd, TCGETA, (long)&t);
11525 + /* Save things we may need later. */
11527 + lflag = t.c_lflag;
11529 + /* Copy the entire structure then fix up as necessary. */
11530 + copy_from_user(&t, it, sizeof(struct svr_termio));
11532 + /* If ICANON isn't set then we've been given VMIN in place
11535 + if (!(t.c_lflag & 0000002)) {
11536 + t.c_cc[6] = t.c_cc[4];
11540 + if (t.c_cflag & 0100000) /* CRTSFL - SCO only? */
11541 + t.c_cflag |= CRTSCTS;
11542 + t.c_cflag &= ~0170000; /* LOBLK|CTSFLOW|RTSFLOW|CRTSFL */
11544 + set_fs(get_ds());
11545 + error = sys_ioctl(fd, op, (long)&t);
11552 +linux_to_svr_termio(int fd, struct svr_termio *it)
11558 + error = verify_area(VERIFY_WRITE, it, sizeof(struct svr_termio));
11563 + set_fs(get_ds());
11564 + error = sys_ioctl(fd, TCGETA, (long)&t);
11570 + /* If ICANON isn't set then we substitute VEOF with VMIN. */
11571 + if (!(t.c_lflag & 0000002))
11572 + t.c_cc[4] = t.c_cc[6];
11574 + /* Copy to the user supplied structure. */
11575 + copy_to_user(it, &t, sizeof(struct svr_termio));
11581 +svr4_to_linux_termios(int fd, int op, struct svr4_termios *it)
11583 + struct termios t;
11585 + u_short lflag, r;
11586 + char svr4_cc[SVR4_NCCS];
11589 + error = verify_area(VERIFY_READ, it, sizeof(struct svr4_termios));
11594 + set_fs(get_ds());
11595 + error = sys_ioctl(fd, TCGETS, (long)&t);
11601 + __get_user(t.c_iflag, &it->c_iflag);
11602 + t.c_iflag &= ~0100000; /* DOSMODE */
11604 + __get_user(t.c_oflag, &it->c_oflag);
11605 + __get_user(t.c_cflag, &it->c_cflag);
11607 + if (t.c_cflag & 0100000) /* CRTSFL - SCO only? */
11608 + t.c_cflag |= CRTSCTS;
11610 + t.c_cflag &= ~0170000; /* LOBLK|CTSFLOW|RTSFLOW|CRTSFL */
11612 + lflag = t.c_lflag;
11613 + t.c_lflag &= ~0100777;
11614 + __get_user(r, &it->c_lflag);
11617 + if ((t.c_lflag & 0100000))
11618 + sys_ioctl(fd, TIOCEXCL, 0);
11620 + sys_ioctl(fd, TIOCNXCL, 0);
11622 + t.c_lflag &= ~0100000;
11623 + t.c_lflag |= (t.c_lflag & 0000400) << 7; /* Move IEXTEN */
11624 + t.c_lflag &= ~0000400;
11625 + t.c_lflag |= (t.c_lflag & 0001000) >> 1; /* Move TOSTOP */
11626 + t.c_lflag &= ~0001000;
11627 + t.c_lflag |= (lflag & 0001000); /* Restore ECHOCTL */
11629 + copy_from_user(svr4_cc, &it->c_cc, SVR4_NCCS);
11630 + t.c_cc[0] = svr4_cc[0];
11631 + t.c_cc[1] = svr4_cc[1];
11632 + t.c_cc[2] = svr4_cc[2];
11633 + t.c_cc[3] = svr4_cc[3];
11634 + t.c_cc[7] = svr4_cc[7];
11635 + t.c_cc[8] = svr4_cc[8];
11636 + t.c_cc[9] = svr4_cc[9];
11637 + t.c_cc[10] = svr4_cc[10];
11638 + t.c_cc[12] = svr4_cc[12];
11639 + t.c_cc[13] = svr4_cc[13];
11640 + t.c_cc[14] = svr4_cc[14];
11641 + t.c_cc[15] = svr4_cc[15];
11642 + t.c_cc[16] = svr4_cc[16];
11644 + if (t.c_lflag & ICANON) {
11645 + t.c_cc[4] = svr4_cc[4];
11646 + t.c_cc[11] = svr4_cc[5];
11648 + t.c_cc[5] = svr4_cc[5];
11649 + t.c_cc[6] = svr4_cc[4];
11650 + t.c_cc[11] = svr4_cc[6];
11653 + set_fs(get_ds());
11654 + error = sys_ioctl(fd, op, (long)&t);
11661 +linux_to_svr4_termios(int fd, int op, struct svr4_termios *it)
11663 + struct termios t;
11664 + char svr4_cc[SVR4_NCCS];
11668 + error = verify_area(VERIFY_WRITE, it, sizeof(struct svr4_termios));
11673 + set_fs(get_ds());
11674 + error = sys_ioctl(fd, op, (long)&t);
11680 + put_user(t.c_iflag & 0017777, &it->c_iflag);
11681 + put_user(t.c_oflag & 0177777, &it->c_oflag);
11683 + if (t.c_cflag & CRTSCTS)
11684 + t.c_cflag |= 0100000; /* CRTSFL - SCO only? */
11685 + put_user(t.c_cflag & 0177777, &it->c_cflag);
11687 + t.c_lflag &= ~0001000;
11688 + t.c_lflag |= (t.c_lflag & 0000400) << 1;
11689 + t.c_lflag &= ~0000400;
11690 + t.c_lflag |= (t.c_lflag & 0100000) >> 7;
11691 + t.c_lflag &= ~0100000;
11692 + put_user(t.c_lflag & 0001777, &it->c_lflag);
11694 + svr4_cc[0] = t.c_cc[0];
11695 + svr4_cc[1] = t.c_cc[1];
11696 + svr4_cc[2] = t.c_cc[2];
11697 + svr4_cc[3] = t.c_cc[3];
11698 + svr4_cc[6] = t.c_cc[16];
11699 + svr4_cc[7] = t.c_cc[7];
11700 + svr4_cc[8] = t.c_cc[8];
11701 + svr4_cc[9] = t.c_cc[9];
11702 + svr4_cc[10] = t.c_cc[10];
11703 + svr4_cc[11] = t.c_cc[10];
11704 + svr4_cc[12] = t.c_cc[12];
11705 + svr4_cc[13] = t.c_cc[13];
11706 + svr4_cc[14] = t.c_cc[14];
11707 + svr4_cc[15] = t.c_cc[15];
11709 + if (t.c_lflag & ICANON) {
11710 + svr4_cc[4] = t.c_cc[4];
11711 + svr4_cc[5] = t.c_cc[11];
11713 + svr4_cc[4] = t.c_cc[6];
11714 + svr4_cc[5] = t.c_cc[5];
11717 + copy_to_user(&it->c_cc, svr4_cc, SVR4_NCCS);
11723 +svr4_term_ioctl(int fd, u_int cmd, caddr_t data)
11726 + case 1: /* TCGETA (TIOC|1) */
11727 + return linux_to_svr_termio(fd,
11728 + (struct svr_termio *)data);
11729 + case 2: /* TCSETA (TIOC|2) */
11730 + return svr_to_linux_termio(fd, TCSETA,
11731 + (struct svr_termio *)data);
11732 + case 3: /* TCSETAW (TIOC|3) */
11733 + return svr_to_linux_termio(fd, TCSETAW,
11734 + (struct svr_termio *)data);
11735 + case 4: /* TCSETAF (TIOC|4) */
11736 + return svr_to_linux_termio(fd, TCSETAF,
11737 + (struct svr_termio *)data);
11738 + case 5: /* TCSBRK (TIOC|5) */
11739 + return sys_ioctl(fd, TCSBRK, (long)data);
11740 + case 6: /* TCXONC (TIOC|6) */
11741 + return sys_ioctl(fd, TCXONC, (long)data);
11742 + case 7: /* TCFLSH (TIOC|7) */
11743 + return sys_ioctl(fd, TCFLSH, (long)data);
11744 + /* This group appear in SVR4 but not SVR3 (SCO). */
11745 + case 8: /* TIOCKBON */
11746 + case 9: /* TIOCKBOF */
11747 + case 10: /* KBENABLED */
11750 + /* This set is used by SVR4 for termios ioctls. */
11751 + case 13: /* TCGETS */
11752 + return linux_to_svr4_termios(fd, TCGETS,
11753 + (struct svr4_termios *)data);
11754 + case 14: /* TCSETS */
11755 + return svr4_to_linux_termios(fd, TCSETS,
11756 + (struct svr4_termios *)data);
11757 + case 15: /* TCSETSW */
11758 + return svr4_to_linux_termios(fd, TCSETSW,
11759 + (struct svr4_termios *)data);
11760 + case 16: /* TCSETSF */
11761 + return svr4_to_linux_termios(fd, TCSETSF,
11762 + (struct svr4_termios *)data);
11764 + /* These two are specific to ISC. */
11765 + case 20: /* TCSETPGRP (TIOC|20) set pgrp of tty */
11766 + return sys_ioctl(fd, TIOCSPGRP, (long)data);
11767 + case 21: /* TCGETPGRP (TIOC|21) get pgrp of tty */
11768 + return sys_ioctl(fd, TIOCGPGRP, (long)data);
11770 + case 34: /* TCGETSC (TIOC|34) ioctl for scancodes */
11771 + return 0x04; /* Translates scancode to ascii */
11772 + case 35: /* TCSETSC (TIOC|35) ioctl for scancodes */
11775 + case 103: /* TIOCSWINSZ (TIOC|103) */
11776 + return sys_ioctl(fd, TIOCSWINSZ, (long)data);
11777 + case 104: /* TIOCGWINSZ (TIOC|104) */
11778 + return sys_ioctl(fd, TIOCGWINSZ, (long)data);
11780 + case 118: /* TIOCSPGRP (TIOC|118) set pgrp of tty */
11781 + return sys_ioctl(fd, TIOCSPGRP, (long)data);
11782 + case 119: /* TIOCGPGRP (TIOC|119) get pgrp of tty */
11783 + return sys_ioctl(fd, TIOCGPGRP, (long)data);
11785 + case 32: /* TCDSET (TIOC|32) */
11786 + case 33: /* RTS_TOG (TIOC|33) 386 - "RTS" toggle define 8A1 protocol */
11788 + case 120: /* TIOSETSAK (TIOC|120) set SAK sequence for tty */
11789 + case 121: /* TIOGETSAK (TIOC|121) get SAK sequence for tty */
11790 + printk(KERN_ERR "iBCS: termio ioctl %d unimplemented\n", cmd);
11794 + printk(KERN_ERR "iBCS: termio ioctl %d unsupported\n", cmd);
11799 + unsigned short x_hflag;
11800 + unsigned short x_cflag;
11801 + unsigned short x_rflag[5];
11802 + unsigned short x_sflag;
11805 +#define RTSXOFF 0x0001
11806 +#define CTSXON 0x0002
11809 +svr4_termiox_ioctl(int fd, u_int cmd, caddr_t data)
11811 + struct termios t;
11812 + struct termiox tx;
11816 + if (cmd < 1 || cmd > 4)
11819 + error = verify_area(cmd == 1 ? VERIFY_WRITE : VERIFY_READ,
11820 + data, sizeof(struct termiox));
11825 + set_fs(get_ds());
11826 + error = sys_ioctl(fd, TCGETS, (long)&t);
11832 + if (cmd == 1) { /* TCGETX */
11833 + memset(&tx, '\0', sizeof(struct termiox));
11834 + if (t.c_cflag & CRTSCTS)
11835 + tx.x_hflag = RTSXOFF|CTSXON;
11836 + copy_to_user(data, &tx, sizeof(struct termiox));
11840 + copy_from_user(&tx, data, sizeof(struct termiox));
11841 + if ((tx.x_hflag != 0 && tx.x_hflag != (RTSXOFF|CTSXON))
11842 + || tx.x_cflag || tx.x_rflag[0] || tx.x_rflag[1]
11843 + || tx.x_rflag[2] || tx.x_rflag[3] || tx.x_rflag[4]
11848 + t.c_cflag |= CRTSCTS;
11850 + t.c_cflag &= (~CRTSCTS);
11853 + set_fs(get_ds());
11855 + case 2: /* TCSETX */
11856 + error = sys_ioctl(fd, TCSETS, (long)&t);
11858 + case 3: /* TCSETXW */
11859 + error = sys_ioctl(fd, TCSETSW, (long)&t);
11861 + case 4: /* TCSETXF */
11862 + error = sys_ioctl(fd, TCSETSF, (long)&t);
11869 +#define BSD_NCCS 20
11870 +struct bsd_termios {
11871 + unsigned long c_iflag;
11872 + unsigned long c_oflag;
11873 + unsigned long c_cflag;
11874 + unsigned long c_lflag;
11875 + unsigned char c_cc[BSD_NCCS];
11879 +static unsigned long speed_map[] = {
11880 + 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400,
11881 + 4800, 9600, 19200, 38400
11884 +static unsigned long
11885 +bsd_to_linux_speed(unsigned long s)
11898 + for (i=0; i<sizeof(speed_map)/sizeof(speed_map[0]); i++)
11899 + if (s <= speed_map[i])
11904 +static unsigned long
11905 +linux_to_bsd_speed(unsigned long s)
11912 + if (s == B115200)
11915 + return speed_map[s];
11922 +bsd_to_linux_termios(int fd, int op, struct bsd_termios *it)
11924 + struct termios t;
11925 + mm_segment_t old_fs;
11926 + unsigned long temp;
11927 + char bsd_cc[BSD_NCCS];
11930 + error = verify_area(VERIFY_READ, it, sizeof(struct bsd_termios));
11934 + old_fs = get_fs();
11935 + set_fs(get_ds());
11936 + error = sys_ioctl(fd, TCGETS, (long)&t);
11941 + __get_user(t.c_iflag, &it->c_iflag);
11942 + t.c_iflag = (t.c_iflag & ~0xc00)
11943 + | ((t.c_iflag & 0x400) << 1)
11944 + | ((t.c_iflag & 0x800) >> 1);
11946 + get_user(temp, &it->c_oflag);
11947 + t.c_oflag = (t.c_oflag & ~0x1805)
11949 + | ((temp & 2) << 1)
11950 + | ((temp & 4) << 10)
11951 + | ((temp & 4) << 9);
11953 + get_user(temp, &it->c_cflag);
11954 + t.c_cflag = (t.c_cflag & ~0xfff)
11955 + | ((temp & 0xff00) >> 4);
11956 + if (t.c_cflag & 0x30000)
11957 + t.c_cflag |= 020000000000;
11958 + t.c_cflag |= bsd_to_linux_speed(({long s; get_user(s, &it->c_ospeed); s;}))
11959 + | (bsd_to_linux_speed(({long s; get_user(s, &it->c_ispeed); s;})) << 16);
11961 + get_user(temp, &it->c_lflag);
11962 + t.c_lflag = (t.c_lflag & ~0157663)
11963 + | ((temp & 1) << 12)
11964 + | ((temp & 0x46) << 3)
11965 + | ((temp & 0x420) << 5)
11966 + | ((temp & 0x180) >> 7)
11967 + | ((temp & 0x400000) >> 14)
11968 + | ((temp & 0x2800000) >> 11)
11969 + | ((temp & 0x80000000) >> 24);
11971 + copy_from_user(bsd_cc, &it->c_cc, BSD_NCCS);
11972 + t.c_cc[VEOF] = bsd_cc[0];
11973 + t.c_cc[VEOL] = bsd_cc[1];
11974 + t.c_cc[VEOL2] = bsd_cc[2];
11975 + t.c_cc[VERASE] = bsd_cc[3];
11976 + t.c_cc[VWERASE] = bsd_cc[4];
11977 + t.c_cc[VKILL] = bsd_cc[5];
11978 + t.c_cc[VREPRINT] = bsd_cc[6];
11979 + t.c_cc[VSWTC] = bsd_cc[7];
11980 + t.c_cc[VINTR] = bsd_cc[8];
11981 + t.c_cc[VQUIT] = bsd_cc[9];
11982 + t.c_cc[VSUSP] = bsd_cc[10];
11983 +/* t.c_cc[VDSUSP] = bsd_cc[11];*/
11984 + t.c_cc[VSTART] = bsd_cc[12];
11985 + t.c_cc[VSTOP] = bsd_cc[13];
11986 + t.c_cc[VLNEXT] = bsd_cc[14];
11987 + t.c_cc[VDISCARD] = bsd_cc[15];
11988 + t.c_cc[VMIN] = bsd_cc[16];
11989 + t.c_cc[VTIME] = bsd_cc[17];
11990 +/* t.c_cc[VSTATUS] = bsd_cc[18];*/
11992 + set_fs(get_ds());
11993 + error = sys_ioctl(fd, op, (long)&t);
12001 +linux_to_bsd_termios(int fd, int op, struct bsd_termios *it)
12003 + struct termios t;
12004 + char bsd_cc[BSD_NCCS];
12005 + mm_segment_t old_fs;
12008 + error = verify_area(VERIFY_WRITE, it, sizeof(struct bsd_termios));
12012 + old_fs = get_fs();
12013 + set_fs(get_ds());
12014 + error = sys_ioctl(fd, op, (long)&t);
12019 + put_user((t.c_iflag & 0777)
12020 + | ((t.c_iflag & 02000) >> 1)
12021 + | ((t.c_iflag & 010000) >> 2)
12022 + | ((t.c_iflag & 020000) >> 4),
12025 + put_user((t.c_oflag & 1)
12026 + | ((t.c_oflag & 04) >> 1)
12027 + | ((t.c_oflag & 014000) == 014000 ? 4 : 0),
12030 + put_user((t.c_cflag & ~020000007777)
12031 + | ((t.c_cflag & 0xff0) << 4)
12032 + | ((t.c_cflag & 020000000000) ? 0x30000 : 0),
12035 + put_user(linux_to_bsd_speed(t.c_cflag & CBAUD), &it->c_ospeed);
12036 + if ((t.c_cflag & CIBAUD) != 0)
12037 + put_user(linux_to_bsd_speed((t.c_cflag & CIBAUD) >> 16),
12040 + put_user(linux_to_bsd_speed(t.c_cflag & CBAUD),
12043 + put_user((t.c_lflag & 07777626010)
12044 + | ((t.c_lflag & 03) << 7)
12045 + | ((t.c_lflag & 01160) >> 3)
12046 + | ((t.c_lflag & 0400) << 14)
12047 + | ((t.c_lflag & 02000) >> 4)
12048 + | ((t.c_lflag & 04000) >> 11)
12049 + | ((t.c_lflag & 010000) << 11)
12050 + | ((t.c_lflag & 040000) << 15)
12051 + | ((t.c_lflag & 0100000) >> 5),
12054 + bsd_cc[0] = t.c_cc[VEOF];
12055 + bsd_cc[1] = t.c_cc[VEOL];
12056 + bsd_cc[2] = t.c_cc[VEOL2];
12057 + bsd_cc[3] = t.c_cc[VERASE];
12058 + bsd_cc[4] = t.c_cc[VWERASE];
12059 + bsd_cc[5] = t.c_cc[VKILL];
12060 + bsd_cc[6] = t.c_cc[VREPRINT];
12061 + bsd_cc[7] = t.c_cc[VSWTC];
12062 + bsd_cc[8] = t.c_cc[VINTR];
12063 + bsd_cc[9] = t.c_cc[VQUIT];
12064 + bsd_cc[10] = t.c_cc[VSUSP];
12065 + bsd_cc[11] = t.c_cc[VSUSP];
12066 + bsd_cc[12] = t.c_cc[VSTART];
12067 + bsd_cc[13] = t.c_cc[VSTOP];
12068 + bsd_cc[14] = t.c_cc[VLNEXT];
12069 + bsd_cc[15] = t.c_cc[VDISCARD];
12070 + bsd_cc[16] = t.c_cc[VMIN];
12071 + bsd_cc[17] = t.c_cc[VTIME];
12072 + bsd_cc[18] = 0; /* t.c_cc[VSTATUS]; */
12075 + copy_to_user(&it->c_cc, bsd_cc, BSD_NCCS);
12083 +struct v7_sgttyb {
12084 + unsigned char sg_ispeed;
12085 + unsigned char sg_ospeed;
12086 + unsigned char sg_erase;
12087 + unsigned char sg_kill;
12091 +struct v7_tchars {
12100 +struct v7_ltchars {
12110 +int bsd_ioctl_termios(int fd, unsigned int func, void *data)
12112 + switch (func & 0xff) {
12113 + case 0: { /* TIOCGETD */
12114 + unsigned long ldisc;
12115 + mm_segment_t old_fs;
12118 + error = verify_area(VERIFY_WRITE, data,
12119 + sizeof(unsigned short));
12123 + old_fs = get_fs();
12124 + set_fs(get_ds());
12125 + error = sys_ioctl(fd, TIOCGETD, (long)&ldisc);
12128 + put_user(ldisc, (unsigned short *)data);
12131 + case 1: { /* TIOCSETD */
12132 + unsigned long ldisc;
12133 + mm_segment_t old_fs;
12136 + error = verify_area(VERIFY_READ, data,
12137 + sizeof(unsigned short));
12141 + get_user(ldisc, (unsigned short *)data);
12142 + old_fs = get_fs();
12143 + set_fs(get_ds());
12144 + error = sys_ioctl(fd, TIOCSETD, (long)&ldisc);
12149 + case 2: { /* TIOCHPCL */
12151 + mm_segment_t old_fs;
12152 + struct termios t;
12154 + old_fs = get_fs();
12155 + set_fs(get_ds());
12156 + error = sys_ioctl(fd, TCGETS, (long)&t);
12162 + t.c_cflag |= HUPCL;
12164 + t.c_cflag &= ~HUPCL;
12166 + old_fs = get_fs();
12167 + set_fs(get_ds());
12168 + error = sys_ioctl(fd, TCSETS, (long)&t);
12173 + case 8: { /* TIOCGETP */
12175 + mm_segment_t old_fs;
12176 + struct termios t;
12177 + struct v7_sgttyb sg;
12179 + error = verify_area(VERIFY_WRITE, data, sizeof(sg));
12183 + old_fs = get_fs();
12184 + set_fs(get_ds());
12185 + error = sys_ioctl(fd, TCGETS, (long)&t);
12190 + sg.sg_ispeed = sg.sg_ospeed = 0;
12191 + sg.sg_erase = t.c_cc[VERASE];
12192 + sg.sg_kill = t.c_cc[VKILL];
12194 + /* Old - became TANDEM instead.
12195 + * ((t.c_cflag & HUPCL) >> 10)
12198 +/* O_ODDP */ ((t.c_cflag & PARODD) >> 3)
12199 +/* O_EVENP */ | ((t.c_cflag & PARENB) >> 1)
12200 +/* LITOUT */ | ((t.c_cflag & OPOST) ? 0 : 0x200000)
12201 +/* O_CRMOD */ | ((t.c_oflag & ONLCR) << 2)
12202 +/* O_NL1|O_VTDELAY */ | (t.c_oflag & (NL1|VTDLY))
12203 +/* O_TBDELAY */ | ((t.c_oflag & TABDLY) ? 02000 : 0)
12204 +/* O_CRDELAY */ | ((t.c_oflag & CRDLY) << 3)
12205 +/* O_BSDELAY */ | ((t.c_oflag & BSDLY) << 2)
12206 +/* O_ECHO|O_LCASE */ | (t.c_lflag & (XCASE|ECHO))
12207 + | ((t.c_lflag & ICANON)
12208 +/* O_CBREAK or O_RAW */ ? 0 : ((t.c_lflag & ISIG) ? 0x02 : 0x20))
12209 + /* Incomplete... */
12212 + copy_to_user(data, &sg, sizeof(sg));
12216 + case 9: /* TIOCSETP */
12217 + case 10: { /* TIOCSETN */
12219 + mm_segment_t old_fs;
12220 + struct termios t;
12221 + struct v7_sgttyb sg;
12223 + error = verify_area(VERIFY_READ, data, sizeof(sg));
12226 + copy_from_user(&sg, data, sizeof(sg));
12228 + old_fs = get_fs();
12229 + set_fs(get_ds());
12230 + error = sys_ioctl(fd, TCGETS, (long)&t);
12235 + t.c_cc[VERASE] = sg.sg_erase;
12236 + t.c_cc[VKILL] = sg.sg_kill;
12237 + t.c_iflag = ICRNL | IXON;
12239 + t.c_lflag = ISIG | ICANON;
12240 + if (sg.sg_flags & 0x02) /* O_CBREAK */
12241 + t.c_lflag &= (~ICANON);
12242 + if (sg.sg_flags & 0x08) /* O_ECHO */
12243 + t.c_lflag |= ECHO|ECHOE|ECHOK|ECHOCTL|ECHOKE|IEXTEN;
12244 + if (sg.sg_flags & 0x10) /* O_CRMOD */
12245 + t.c_oflag |= OPOST|ONLCR;
12246 + if (sg.sg_flags & 0x20) { /* O_RAW */
12248 + t.c_lflag &= ~(ISIG|ICANON);
12250 + if (sg.sg_flags & 0x200000) /* LITOUT */
12251 + t.c_oflag &= (~OPOST);
12252 + if (!(t.c_lflag & ICANON)) {
12253 + t.c_cc[VMIN] = 1;
12254 + t.c_cc[VTIME] = 0;
12257 + old_fs = get_fs();
12258 + set_fs(get_ds());
12259 + error = sys_ioctl(fd, TCSETS, (long)&t);
12264 + case 17: { /* TIOCSETC */
12266 + mm_segment_t old_fs;
12267 + struct termios t;
12268 + struct v7_tchars tc;
12270 + error = verify_area(VERIFY_READ, data, sizeof(tc));
12273 + copy_from_user(&tc, data, sizeof(tc));
12275 + old_fs = get_fs();
12276 + set_fs(get_ds());
12277 + error = sys_ioctl(fd, TCGETS, (long)&t);
12282 + t.c_cc[VINTR] = tc.t_intrc;
12283 + t.c_cc[VQUIT] = tc.t_quitc;
12284 + t.c_cc[VSTART] = tc.t_startc;
12285 + t.c_cc[VSTOP] = tc.t_stopc;
12286 + t.c_cc[VEOF] = tc.t_eofc;
12287 + t.c_cc[VEOL2] = tc.t_brkc;
12289 + old_fs = get_fs();
12290 + set_fs(get_ds());
12291 + error = sys_ioctl(fd, TCSETS, (long)&t);
12296 + case 18: { /* TIOCGETC */
12298 + mm_segment_t old_fs;
12299 + struct termios t;
12300 + struct v7_tchars tc;
12302 + error = verify_area(VERIFY_WRITE, data, sizeof(tc));
12306 + old_fs = get_fs();
12307 + set_fs(get_ds());
12308 + error = sys_ioctl(fd, TCGETS, (long)&t);
12313 + tc.t_intrc = t.c_cc[VINTR];
12314 + tc.t_quitc = t.c_cc[VQUIT];
12315 + tc.t_startc = t.c_cc[VSTART];
12316 + tc.t_stopc = t.c_cc[VSTOP];
12317 + tc.t_eofc = t.c_cc[VEOF];
12318 + tc.t_brkc = t.c_cc[VEOL2];
12320 + copy_to_user(data, &tc, sizeof(tc));
12324 + case 116: { /* TIOCGLTC */
12326 + mm_segment_t old_fs;
12327 + struct termios t;
12328 + struct v7_ltchars tc;
12330 + error = verify_area(VERIFY_WRITE, data, sizeof(tc));
12334 + old_fs = get_fs();
12335 + set_fs(get_ds());
12336 + error = sys_ioctl(fd, TCGETS, (long)&t);
12341 + tc.t_suspc = t.c_cc[VSUSP];
12342 + tc.t_dsuspc = t.c_cc[VSUSP];
12343 + tc.t_rprntc = t.c_cc[VREPRINT];
12344 + tc.t_flushc = t.c_cc[VEOL2];
12345 + tc.t_werasc = t.c_cc[VWERASE];
12346 + tc.t_lnextc = t.c_cc[VLNEXT];
12348 + copy_to_user(data, &tc, sizeof(tc));
12352 + case 117: { /* TIOCSLTC */
12354 + mm_segment_t old_fs;
12355 + struct termios t;
12356 + struct v7_ltchars tc;
12358 + error = verify_area(VERIFY_READ, data, sizeof(tc));
12361 + copy_from_user(&tc, data, sizeof(tc));
12363 + old_fs = get_fs();
12364 + set_fs(get_ds());
12365 + error = sys_ioctl(fd, TCGETS, (long)&t);
12370 + t.c_cc[VSUSP] = tc.t_suspc;
12371 + t.c_cc[VEOL2] = tc.t_dsuspc;
12372 + t.c_cc[VREPRINT] = tc.t_rprntc;
12373 + t.c_cc[VEOL2] = tc.t_flushc;
12374 + t.c_cc[VWERASE] = tc.t_werasc;
12375 + t.c_cc[VLNEXT] = tc.t_lnextc;
12377 + old_fs = get_fs();
12378 + set_fs(get_ds());
12379 + error = sys_ioctl(fd, TCSETS, (long)&t);
12384 + case 13: /* TIOEXCL */
12385 + return sys_ioctl(fd, TIOCEXCL, (long)data);
12387 + case 14: /* TIOCNXCL */
12388 + return sys_ioctl(fd, TIOCNXCL, (long)data);
12390 + case 16: /* TIOCFLUSH */
12391 + return sys_ioctl(fd, TCFLSH, (long)data);
12394 + /* ISC (maybe SVR4 in general?) has some extensions over
12395 + * the sgtty stuff. So do later BSDs. Needless to say they
12396 + * both have different extensions.
12398 + case 20: /* TCSETPGRP (TIOC|20) set pgrp of tty */
12399 + return bsd_to_linux_termios(fd, TCSETS, data);
12401 + case 21: /* TCGETPGRP (TIOC|21) get pgrp of tty */
12402 + return bsd_to_linux_termios(fd, TCSETSW, data);
12404 + case 19: /* TIOCGETA */
12405 + return linux_to_bsd_termios(fd, TCGETS, data);
12407 + case 22: /* TIOCSETAF */
12408 + return bsd_to_linux_termios(fd, TCSETSF, data);
12410 + case 26: /* TIOCGETD */
12411 + return sys_ioctl(fd, TIOCGETD, (long)data);
12413 + case 27: /* TIOCSETD */
12414 + return sys_ioctl(fd, TIOCSETD, (long)data);
12416 + case 97: /* TIOCSCTTY */
12417 + return sys_ioctl(fd, TIOCSCTTY, (long)data);
12419 + case 103: /* TIOCSWINSZ */
12420 + return sys_ioctl(fd, TIOCSWINSZ, (long)data);
12422 + case 104: /* TIOCGWINSZ */
12423 + return sys_ioctl(fd, TIOCGWINSZ, (long)data);
12425 + case 113: /* TIOCNOTTY */
12426 + return sys_ioctl(fd, TIOCNOTTY, (long)data);
12428 + case 118: /* TIOCSPGRP */
12429 + return sys_ioctl(fd, TIOCSPGRP, (long)data);
12431 + case 119: /* TIOCGPGRP */
12432 + return sys_ioctl(fd, TIOCGPGRP, (long)data);
12434 + case 123: /* TIOCSBRK */
12435 + return sys_ioctl(fd, TCSBRK, (long)data);
12437 + case 124: /* TIOCLGET */
12438 + case 125: /* TIOCLSET */
12442 + case 3: /* TIOCMODG */
12443 + case 4: /* TIOCMODS */
12444 + case 94: /* TIOCDRAIN */
12445 + case 95: /* TIOCSIG */
12446 + case 96: /* TIOCEXT */
12447 + case 98: /* TIOCCONS */
12448 + case 102: /* TIOCUCNTL */
12449 + case 105: /* TIOCREMOTE */
12450 + case 106: /* TIOCMGET */
12451 + case 107: /* TIOCMBIC */
12452 + case 108: /* TIOCMBIS */
12453 + case 109: /* TIOCMSET */
12454 + case 110: /* TIOCSTART */
12455 + case 111: /* TIOCSTOP */
12456 + case 112: /* TIOCPKT */
12457 + case 114: /* TIOCSTI */
12458 + case 115: /* TIOCOUTQ */
12459 + case 120: /* TIOCCDTR */
12460 + case 121: /* TIOCSDTR */
12461 + case 122: /* TIOCCBRK */
12465 + printk(KERN_ERR "BSD/V7: terminal ioctl 0x%08lx unsupported\n",
12466 + (unsigned long)func);
12470 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
12471 +EXPORT_SYMBOL(bsd_ioctl_termios);
12472 +EXPORT_SYMBOL(svr4_term_ioctl);
12474 diff -Nru linux-2.6.7/abi/svr4/timod.c linux-2.6.7-abi/abi/svr4/timod.c
12475 --- linux-2.6.7/abi/svr4/timod.c 1970-01-01 01:00:00.000000000 +0100
12476 +++ linux-2.6.7-abi/abi/svr4/timod.c 2004-07-22 17:44:21.000000000 +0200
12479 + * Copyright 1995, 1996 Mike Jagdis (jaggy@purplet.demon.co.uk)
12484 +#include <linux/config.h>
12485 +#include <linux/types.h>
12486 +#include <linux/errno.h>
12487 +#include <linux/fs.h>
12488 +#include <linux/ptrace.h>
12489 +#include <linux/sched.h>
12490 +#include <linux/kernel.h>
12491 +#include <linux/slab.h>
12492 +#include <linux/mm.h>
12493 +#include <linux/fcntl.h>
12494 +#include <linux/socket.h>
12495 +#include <linux/in.h>
12496 +#include <linux/un.h>
12497 +#include <linux/file.h>
12498 +#include <linux/personality.h>
12499 +#include <linux/poll.h>
12500 +#include <linux/syscalls.h>
12501 +#include <asm/uaccess.h>
12503 +#include <net/sock.h>
12505 +#include <asm/abi_machdep.h>
12506 +#include <abi/stream.h>
12507 +#include <abi/tli.h>
12509 +#include <abi/svr4/ioctl.h>
12510 +#include <abi/util/trace.h>
12514 + * Check if the inode belongs to /dev/socksys.
12516 +#define IS_SOCKSYS(ip) (MAJOR((ip)->i_rdev) == SOCKSYS_MAJOR)
12520 +timod_getmsg(int fd, struct inode *ip, int pmsg, struct pt_regs *regs)
12522 + struct strbuf ctl, *ctlp, dat, *datp;
12523 + int flags, *flagsp, *bandp;
12526 + ctlp = (struct strbuf *)get_syscall_parameter(regs, 1);
12527 + datp = (struct strbuf *)get_syscall_parameter(regs, 2);
12530 + bandp = (int *)get_syscall_parameter(regs, 3);
12531 + flagsp = (int *)get_syscall_parameter(regs, 4);
12533 + flagsp = (int *)get_syscall_parameter (regs, 3);
12536 + if (copy_from_user(&ctl, ctlp, sizeof(ctl)))
12538 + if ((error = put_user(-1, &ctlp->len)))
12544 + if (copy_from_user(&dat, datp, sizeof(dat)))
12546 + if ((error = put_user(-1, &datp->len)))
12551 + if ((error = get_user(flags, flagsp)))
12554 +#ifdef CONFIG_ABI_SPX
12555 + if (IS_SOCKSYS(ip) && MINOR(ip->i_rdev) == 1) {
12557 +#if defined(CONFIG_ABI_TRACE)
12558 + abi_trace(ABI_TRACE_STREAMS,
12559 + "SPX: getmsg offers descriptor %d\n", fd);
12562 + if ((error = put_user(fd, ctl.buf)))
12564 + if ((error = put_user(4, &ctlp->len)))
12569 +#endif /* CONFIG_ABI_SPX */
12571 +#ifdef CONFIG_ABI_XTI
12572 + if (flags == 0 || flags == MSG_HIPRI ||
12573 + flags == MSG_ANY || flags == MSG_BAND) {
12577 + error = do_getmsg(fd, regs, ctl.buf, ctl.maxlen, &ctlp->len,
12578 + dat.buf, dat.maxlen, &datp->len, &flags);
12582 + error = put_user(flags, flagsp);
12586 +#if defined(CONFIG_ABI_TRACE)
12587 + abi_trace(ABI_TRACE_STREAMS,
12588 + "XTI: getmsg flags value bad (%d) for %d\n",
12590 +#endif /* CONFIG_ABI_TRACE */
12591 +#endif /* CONFIG_ABI_XTI */
12597 +timod_putmsg(int fd, struct inode *ip, int pmsg, struct pt_regs *regs)
12599 + struct strbuf ctl, *ctlp, dat, *datp;
12603 + ctlp = (struct strbuf *)get_syscall_parameter(regs, 1);
12604 + datp = (struct strbuf *)get_syscall_parameter(regs, 2);
12606 + band = get_syscall_parameter(regs, 3);
12607 + flags = get_syscall_parameter(regs, 4);
12609 + flags = get_syscall_parameter(regs, 3);
12612 + if (copy_from_user(&ctl, ctlp, sizeof(ctl)))
12614 + if (ctl.len < 0 && flags)
12622 + if (copy_from_user(&dat, datp, sizeof(dat)))
12629 +#ifdef CONFIG_ABI_SPX
12630 + if (IS_SOCKSYS(ip) && MINOR(ip->i_rdev) == 1) {
12633 + if (ctl.len != 4)
12636 + error = get_user(newfd, ctl.buf);
12640 +#if defined(CONFIG_ABI_TRACE)
12641 + abi_trace(ABI_TRACE_STREAMS,
12642 + "SPX: putmsg on %d dups descriptor %d\n",
12645 + error = sys_dup2(newfd, fd);
12647 + return (error < 0 ? error : 0);
12649 +#endif /* CONFIG_ABI_SPX */
12651 +#ifdef CONFIG_ABI_XTI
12652 + return do_putmsg(fd, regs, ctl.buf, ctl.len,
12653 + dat.buf, dat.len, flags);
12659 +stream_fdinsert(struct pt_regs *regs, int fd, struct strfdinsert *arg)
12661 + struct strfdinsert sfd;
12663 + if (copy_from_user(&sfd, arg, sizeof(sfd)))
12666 +#if defined(CONFIG_ABI_TRACE)
12667 + abi_trace(ABI_TRACE_STREAMS,
12668 + "%u fdinsert: flags=%ld, fildes=%u, offset=%d\n",
12669 + fd, sfd.flags, sfd.fildes, sfd.offset);
12671 +#ifdef CONFIG_ABI_XTI
12672 + return do_putmsg(fd, regs, sfd.ctlbuf.buf, sfd.ctlbuf.len,
12673 + sfd.datbuf.buf, sfd.datbuf.len, sfd.fildes);
12678 diff -Nru linux-2.6.7/abi/svr4/ulimit.c linux-2.6.7-abi/abi/svr4/ulimit.c
12679 --- linux-2.6.7/abi/svr4/ulimit.c 1970-01-01 01:00:00.000000000 +0100
12680 +++ linux-2.6.7-abi/abi/svr4/ulimit.c 2004-07-22 17:44:21.000000000 +0200
12683 + * Copyright (C) 1993 Joe Portman (baron@hebron.connected.com)
12684 + * First stab at ulimit
12686 + * April 9 1994, corrected file size passed to/from setrlimit/getrlimit
12687 + * -- Graham Adams (gadams@ddrive.demon.co.uk)
12693 +#include <linux/module.h>
12694 +#include <linux/errno.h>
12695 +#include <linux/sched.h>
12696 +#include <linux/kernel.h>
12697 +#include <linux/unistd.h>
12698 +#include <linux/fs.h>
12699 +#include <linux/resource.h>
12700 +#include <linux/syscalls.h>
12701 +#include <asm/uaccess.h>
12703 +#include <abi/util/trace.h>
12707 + * Arguments to ulimit - it's one of the stupid multipled calls...
12709 +#define U_GETFSIZE (1) /* get max file size in blocks */
12710 +#define U_SETFSIZE (2) /* set max file size in blocks */
12711 +#define U_GETMEMLIM (3) /* get process size limit */
12712 +#define U_GETMAXOPEN (4) /* get max open files for this process */
12713 +#define U_GTXTOFF (64) /* get text offset */
12716 + * Define nominal block size parameters.
12718 +#define ULIM_BLOCKSIZE_BITS 9 /* block size = 512 */
12719 +#define ULIM_MAX_BLOCKSIZE (INT_MAX >> ULIM_BLOCKSIZE_BITS)
12723 +svr4_ulimit (int cmd, int val)
12727 + return (current->rlim[RLIMIT_FSIZE].rlim_cur) >> ULIM_BLOCKSIZE_BITS;
12730 + if ((val > ULIM_MAX_BLOCKSIZE) || (val < 0))
12732 + val <<= ULIM_BLOCKSIZE_BITS;
12733 + if (val > current->rlim[RLIMIT_FSIZE].rlim_max) {
12734 + if (!capable(CAP_SYS_RESOURCE))
12736 + current->rlim[RLIMIT_FSIZE].rlim_max = val;
12738 + current->rlim[RLIMIT_FSIZE].rlim_cur = val;
12741 + case U_GETMEMLIM:
12742 + return current->rlim[RLIMIT_DATA].rlim_cur;
12744 + case U_GETMAXOPEN:
12745 + return current->rlim[RLIMIT_NOFILE].rlim_cur;
12748 +#if defined(CONFIG_ABI_TRACE)
12749 + abi_trace(ABI_TRACE_API, "unsupported ulimit call %d\n", cmd);
12756 + * getrlimit/setrlimit args.
12758 +#define U_RLIMIT_CPU 0
12759 +#define U_RLIMIT_FSIZE 1
12760 +#define U_RLIMIT_DATA 2
12761 +#define U_RLIMIT_STACK 3
12762 +#define U_RLIMIT_CORE 4
12763 +#define U_RLIMIT_NOFILE 5
12764 +#define U_RLIMIT_AS 6
12768 +svr4_getrlimit(int cmd, void *val)
12771 + case U_RLIMIT_CPU:
12772 + cmd = RLIMIT_CPU;
12774 + case U_RLIMIT_FSIZE:
12775 + cmd = RLIMIT_FSIZE;
12777 + case U_RLIMIT_DATA:
12778 + cmd = RLIMIT_DATA;
12780 + case U_RLIMIT_STACK:
12781 + cmd = RLIMIT_STACK;
12783 + case U_RLIMIT_CORE:
12784 + cmd = RLIMIT_CORE;
12786 + case U_RLIMIT_NOFILE:
12787 + cmd = RLIMIT_NOFILE;
12789 + case U_RLIMIT_AS:
12796 + return sys_getrlimit(cmd, val);
12800 +svr4_setrlimit(int cmd, void *val)
12803 + case U_RLIMIT_CPU:
12804 + cmd = RLIMIT_CPU;
12806 + case U_RLIMIT_FSIZE:
12807 + cmd = RLIMIT_FSIZE;
12809 + case U_RLIMIT_DATA:
12810 + cmd = RLIMIT_DATA;
12812 + case U_RLIMIT_STACK:
12813 + cmd = RLIMIT_STACK;
12815 + case U_RLIMIT_CORE:
12816 + cmd = RLIMIT_CORE;
12818 + case U_RLIMIT_NOFILE:
12819 + cmd = RLIMIT_NOFILE;
12821 + case U_RLIMIT_AS:
12828 + return sys_getrlimit(cmd, val);
12831 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
12832 +EXPORT_SYMBOL(svr4_getrlimit);
12833 +EXPORT_SYMBOL(svr4_setrlimit);
12834 +EXPORT_SYMBOL(svr4_ulimit);
12836 diff -Nru linux-2.6.7/abi/svr4/utsname.c linux-2.6.7-abi/abi/svr4/utsname.c
12837 --- linux-2.6.7/abi/svr4/utsname.c 1970-01-01 01:00:00.000000000 +0100
12838 +++ linux-2.6.7-abi/abi/svr4/utsname.c 2004-07-22 17:44:21.000000000 +0200
12841 + * Copyright (C) 1994 Mike Jagdis (jaggy@purplet.demon.co.uk)
12842 + * Copyright (C) 1994 Eric Youngdale.
12847 +#include <linux/mm.h>
12848 +#include <linux/sched.h>
12849 +#include <linux/utsname.h>
12850 +#include <linux/module.h>
12851 +#include <asm/uaccess.h>
12854 +struct v7_utsname {
12856 + char nodename[9];
12862 +#define SVR4_NMLN 257
12863 +struct svr4_utsname {
12864 + char sysname[SVR4_NMLN];
12865 + char nodename[SVR4_NMLN];
12866 + char release[SVR4_NMLN];
12867 + char version[SVR4_NMLN];
12868 + char machine[SVR4_NMLN];
12872 +#define set_utsfield(to, from, dotchop) \
12875 + int i, len = (sizeof(to) > sizeof(from) ? sizeof(from) : sizeof(to)); \
12876 + __copy_to_user(to, from, len); \
12878 + for (p=from,i=0; *p && *p != '.' && --len; p++,i++); \
12881 + __put_user('\0', to+i); \
12885 +int v7_utsname(unsigned long addr)
12888 + struct v7_utsname *it = (struct v7_utsname *)addr;
12890 + down_read(&uts_sem);
12891 + error = verify_area(VERIFY_WRITE, it, sizeof (struct v7_utsname));
12893 + set_utsfield(it->sysname, system_utsname.nodename, 1);
12894 + set_utsfield(it->nodename, system_utsname.nodename, 1);
12895 + set_utsfield(it->release, system_utsname.release, 0);
12896 + set_utsfield(it->version, system_utsname.version, 0);
12897 + set_utsfield(it->machine, system_utsname.machine, 0);
12899 + up_read(&uts_sem);
12904 +int abi_utsname(unsigned long addr)
12907 + struct svr4_utsname *it = (struct svr4_utsname *)addr;
12909 + down_read(&uts_sem);
12910 + error = verify_area(VERIFY_WRITE, it, sizeof (struct svr4_utsname));
12912 + set_utsfield(it->sysname, system_utsname.sysname, 0);
12913 + set_utsfield(it->nodename, system_utsname.nodename, 0);
12914 + set_utsfield(it->release, system_utsname.release, 0);
12915 + set_utsfield(it->version, system_utsname.version, 0);
12916 + set_utsfield(it->machine, system_utsname.machine, 0);
12918 + up_read(&uts_sem);
12923 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
12924 +EXPORT_SYMBOL(abi_utsname);
12925 +EXPORT_SYMBOL(v7_utsname);
12927 diff -Nru linux-2.6.7/abi/svr4/xti.c linux-2.6.7-abi/abi/svr4/xti.c
12928 --- linux-2.6.7/abi/svr4/xti.c 1970-01-01 01:00:00.000000000 +0100
12929 +++ linux-2.6.7-abi/abi/svr4/xti.c 2004-07-22 17:44:21.000000000 +0200
12932 + * Copyright 1995, 1996 Mike Jagdis (jaggy@purplet.demon.co.uk)
12937 +#include <linux/config.h>
12938 +#include <linux/types.h>
12939 +#include <linux/errno.h>
12940 +#include <linux/fs.h>
12941 +#include <linux/ptrace.h>
12942 +#include <linux/sched.h>
12943 +#include <linux/kernel.h>
12944 +#include <linux/slab.h>
12945 +#include <linux/mm.h>
12946 +#include <linux/fcntl.h>
12947 +#include <linux/socket.h>
12948 +#include <linux/in.h>
12949 +#include <linux/un.h>
12950 +#include <linux/file.h>
12951 +#include <linux/personality.h>
12952 +#include <linux/poll.h>
12953 +#include <linux/syscalls.h>
12954 +#include <asm/uaccess.h>
12956 +#include <net/sock.h>
12958 +#include <abi/stream.h>
12959 +#include <abi/tli.h>
12961 +#include <abi/socksys.h> /* for socksys_fdinit */
12963 +#include <abi/svr4/sockio.h>
12964 +#include <abi/util/trace.h>
12965 +#include <abi/util/errno.h>
12969 + * This is because TLI and XTI options buffers are incompatible and there
12970 + * is no clear way to detect which format we are dealing with here.
12971 + * Existing systems appear to have TLI options management implemented
12972 + * but return TNOTSUPPORT for XTI requests.
12974 +#if defined(CONFIG_ABI_XTI_OPTMGMT) && defined(CONFIG_ABI_TLI_OPTMGMT)
12975 +# error "unable to support _both_ TLI and XTI option management"
12979 +#if defined(CONFIG_ABI_TRACE)
12980 +static char *const xti_tab[] = {
12981 + "T_CONN_REQ", "T_CONN_RES",
12982 + "T_DISCON_REQ", "T_DATA_REQ",
12983 + "T_EXDATA_REQ", "T_INFO_REQ",
12984 + "T_BIND_REQ", "T_UNBIND_REQ",
12985 + "T_UNITDATA_REQ", "T_OPTMGMT_REQ",
12986 + "T_ORDREL_REQ","T_CONN_IND",
12987 + "T_CONN_CON", "T_DISCON_IND",
12988 + "T_DATA_IND", "T_EXDATA_IND",
12989 + "T_INFO_ACK", "T_BIND_ACK",
12990 + "T_ERROR_ACK","T_OK_ACK",
12991 + "T_UNITDATA_IND", "T_UDERROR_IND",
12992 + "T_OPTMGMT_ACK", "T_ORDREL_IND"
12994 +static char xti_unknown[] = "<unknown>";
12999 + if (n < 0 || n >= ARRAY_SIZE(xti_tab))
13000 + return xti_unknown;
13001 + return xti_tab[n];
13006 +#define timod_mkctl(len) kmalloc(sizeof(struct T_primsg)-sizeof(long)+len, \
13011 +timod_socket_wakeup(struct file *fp)
13013 + struct socket *sock;
13015 + sock = SOCKET_I(fp->f_dentry->d_inode);
13016 + wake_up_interruptible(&sock->wait);
13018 + read_lock(&sock->sk->sk_callback_lock);
13019 + if (sock->fasync_list && !test_bit(SOCK_ASYNC_WAITDATA, &sock->flags))
13020 + __kill_fasync(sock->fasync_list, SIGIO, POLL_IN);
13021 + read_unlock(&sock->sk->sk_callback_lock);
13026 +timod_ok(int fd, int prim)
13029 + struct T_primsg *it;
13030 + struct T_ok_ack *ok;
13032 +#if defined(CONFIG_ABI_TRACE)
13033 + abi_trace(ABI_TRACE_STREAMS, "TI: %u ok ack prim=%d\n", fd, prim);
13037 + it = timod_mkctl(sizeof(struct T_ok_ack));
13041 + ok = (struct T_ok_ack *)&it->type;
13042 + ok->PRIM_type = T_OK_ACK;
13043 + ok->CORRECT_prim = prim;
13045 + it->pri = MSG_HIPRI;
13046 + it->length = sizeof(struct T_ok_ack);
13047 + it->next = Priv(fp)->pfirst;
13049 + Priv(fp)->pfirst = it;
13050 + if (!Priv(fp)->plast)
13051 + Priv(fp)->plast = it;
13052 + timod_socket_wakeup(fp);
13056 +timod_error(int fd, int prim, int terr, int uerr)
13059 + struct T_primsg *it;
13060 + struct T_error_ack *err;
13062 +#if defined(CONFIG_ABI_TRACE)
13063 + abi_trace(ABI_TRACE_STREAMS, "TI: %u error prim=%d, TLI=%d, UNIX=%d\n",
13064 + fd, prim, terr, uerr);
13068 + it = timod_mkctl(sizeof(struct T_error_ack));
13072 + err = (struct T_error_ack *)&it->type;
13073 + err->PRIM_type = T_ERROR_ACK;
13074 + err->ERROR_prim = prim;
13075 + err->TLI_error = terr;
13076 + err->UNIX_error = iABI_errors(uerr);
13078 + it->pri = MSG_HIPRI;
13079 + it->length = sizeof(struct T_error_ack);
13080 + it->next = Priv(fp)->pfirst;
13082 + Priv(fp)->pfirst = it;
13083 + if (!Priv(fp)->plast)
13084 + Priv(fp)->plast = it;
13085 + timod_socket_wakeup(fp);
13089 +#if defined(CONFIG_ABI_XTI_OPTMGMT) || defined(CONFIG_ABI_TLI_OPTMGMT)
13091 + * XXX: this function is a _horrible_ mess.
13094 +timod_optmgmt(int fd, struct pt_regs * regs, int flag,
13095 + char * opt_buf, int opt_len, int do_ret)
13097 + struct file * fp = fcheck(fd);
13098 + char *ret_buf, *ret_base;
13099 + u_long old_esp, *tsp;
13100 + int is_tli, error, failed;
13101 + int ret_len, ret_space;
13103 + if (opt_buf && opt_len > 0) {
13104 + error = verify_area(VERIFY_READ, opt_buf, opt_len);
13111 + * We should be able to detect the difference between
13112 + * TLI and XTI requests at run time?
13114 + is_tli = CONFIG_ABI_TLI_OPTMGMT;
13116 + if (!do_ret && (!opt_buf || opt_len <= 0))
13120 + * Grab some space on the user stack to work with. We need 6 longs
13121 + * to build an argument frame for [gs]etsockopt calls. We also
13122 + * need space to build the return buffer. This will be at least
13123 + * as big as the given options buffer but the given options
13124 + * buffer may not include space for option values so we allow two
13125 + * longs for each option multiple of the option header size
13126 + * and hope that big options will not exhaust our space and
13127 + * trash the stack.
13129 + ret_space = 1024 + opt_len
13130 + + 2*sizeof(long)*(opt_len / (is_tli ? sizeof(struct opthdr) : sizeof(struct t_opthdr)));
13131 + ret_buf = ret_base = (char *)(regs->esp - ret_space);
13134 + old_esp = regs->esp;
13135 + regs->esp -= ret_space + 6*sizeof(long);
13136 + tsp = (unsigned long *)(regs->esp);
13137 + error = verify_area(VERIFY_WRITE, tsp, 6*sizeof(long));
13139 + regs->esp = old_esp;
13145 +#ifndef CONFIG_ABI_TLI_OPTMGMT
13147 + printk(KERN_WARNING
13148 + "%d iBCS: TLI optmgmt requested but not supported\n",
13153 + while (opt_len >= sizeof(struct opthdr)) {
13154 + struct opthdr opt;
13156 +#if defined(CONFIG_ABI_TRACE)
13157 + abi_trace(ABI_TRACE_STREAMS, "TLI optmgmt opt_len=%d, "
13158 + "ret_buf=0x%08lx, ret_len=%d, ret_space=%d\n",
13159 + opt_len, (unsigned long)ret_buf,
13160 + ret_len, ret_space);
13163 + copy_from_user(&opt, opt_buf, sizeof(struct opthdr));
13165 + /* Idiot check... */
13166 + if (opt.len > opt_len) {
13167 + failed = TBADOPT;
13171 + if (abi_traced(ABI_TRACE_STREAMS)) {
13173 + get_user(v, (unsigned long *)(opt_buf+sizeof(struct opthdr)));
13174 +#if defined(CONFIG_ABI_TRACE)
13175 + __abi_trace("TLI optmgmt fd=%d, level=%ld, "
13176 + "name=%ld, value=%ld\n",
13177 + fd, opt.level, opt.name, v);
13181 + /* Check writable space in the return buffer. */
13182 + error = verify_area(VERIFY_WRITE, ret_buf, sizeof(struct opthdr));
13184 + failed = TSYSERR;
13189 + * T_NEGOTIATE means try and set it.
13190 + * T_DEFAULT means get the default value.
13191 + * (return the current for now)
13192 + * T_CHECK means get the current value.
13195 + if (flag == T_NEGOTIATE) {
13196 + put_user(fd, tsp);
13197 + put_user(opt.level, tsp+1);
13198 + put_user(opt.name, tsp+2);
13199 + put_user((int)(opt_buf+sizeof(struct opthdr)), tsp+3);
13200 + put_user(opt.len, tsp+4);
13201 + error = abi_do_setsockopt(tsp);
13204 +#if defined(CONFIG_ABI_TRACE)
13205 + abi_trace(ABI_TRACE_STREAMS,
13206 + "setsockopt failed: %d\n", error);
13208 + failed = TBADOPT;
13215 + put_user(fd, tsp);
13216 + put_user(opt.level, tsp+1);
13217 + put_user(opt.name, tsp+2);
13218 + put_user((int)(ret_buf+sizeof(struct opthdr)), tsp+3);
13219 + put_user((int)(tsp+5), tsp+4);
13220 + put_user(ret_space, tsp+5);
13221 + error = abi_do_getsockopt(tsp);
13224 +#if defined(CONFIG_ABI_TRACE)
13225 + abi_trace(ABI_TRACE_STREAMS,
13226 + "getsockopt failed: %d\n", error);
13228 + failed = TBADOPT;
13232 + get_user(len, tsp+5);
13233 + copy_to_user(ret_buf, &opt, sizeof(opt));
13235 + &((struct opthdr *)opt_buf)->len);
13236 + ret_space -= sizeof(struct opthdr) + len;
13237 + ret_len += sizeof(struct opthdr) + len;
13238 + ret_buf += sizeof(struct opthdr) + len;
13241 + opt_len -= sizeof(struct opthdr) + opt.len;
13242 + opt_buf += sizeof(struct opthdr) + opt.len;
13244 +#endif /* CONFIG_ABI_TLI_OPTMGMT */
13245 +#ifndef CONFIG_ABI_XTI_OPTMGMT
13247 + printk(KERN_WARNING
13248 + "%d iBCS: XTI optmgmt requested but not supported\n",
13252 + else while (opt_len >= sizeof(struct t_opthdr)) {
13253 + struct t_opthdr opt;
13255 + copy_from_user(&opt, opt_buf, sizeof(struct t_opthdr));
13256 + if (opt.len > opt_len) {
13261 + if (abi_traced(ABI_TRACE_STREAMS)) {
13263 + get_user(v, (unsigned long *)(opt_buf+sizeof(struct t_opthdr)));
13264 +#if defined(CONFIG_ABI_TRACE)
13265 + __abi_trace("XTI optmgmt fd=%d, level=%ld, "
13266 + "name=%ld, value=%ld\n",
13267 + fd, opt.level, opt.name, v);
13271 + /* Check writable space in the return buffer. */
13272 + if (verify_area(VERIFY_WRITE, ret_buf, sizeof(struct t_opthdr))) {
13278 + * T_NEGOTIATE means try and set it.
13279 + * T_CHECK means see if we could set it.
13280 + * (so we just set it for now)
13281 + * T_DEFAULT means get the default value.
13282 + * (return the current for now)
13283 + * T_CURRENT means get the current value (SCO xti.h has
13284 + * no T_CURRENT???).
13287 + if (flag == T_NEGOTIATE || flag == T_CHECK) {
13288 + put_user(fd, tsp);
13289 + put_user(opt.level, tsp+1);
13290 + put_user(opt.name, tsp+2);
13291 + put_user((int)(opt_buf+sizeof(struct t_opthdr)), tsp+3);
13292 + put_user(opt.len-sizeof(struct t_opthdr), tsp+4);
13293 + error = abi_do_setsockopt(tsp);
13296 + put_user(fd, tsp);
13297 + put_user(opt.level, tsp+1);
13298 + put_user(opt.name, tsp+2);
13299 + put_user((int)(ret_buf+sizeof(struct t_opthdr)), tsp+3);
13300 + put_user((int)(tsp+5), tsp+4);
13301 + put_user(ret_space, tsp+5);
13302 + error = abi_do_getsockopt(tsp);
13305 + get_user(len, tsp+5);
13306 + /* FIXME: opt.status should be set... */
13307 + copy_to_user(ret_buf, &opt, sizeof(opt));
13308 + put_user(len+sizeof(struct t_opthdr),
13309 + &((struct t_opthdr *)opt_buf)->len);
13310 + ret_space -= sizeof(struct t_opthdr) + len;
13311 + ret_len += sizeof(struct t_opthdr) + len;
13312 + ret_buf += sizeof(struct t_opthdr) + len;
13317 + opt_len -= opt.len;
13318 + opt_buf += opt.len;
13320 +#endif /* CONFIG_ABI_XTI_OPTMGMT */
13323 + /* If there is left over data the supplied options buffer was
13324 + * formatted incorrectly. But we might have done some work so
13325 + * we must fall through and return an acknowledgement I think.
13328 + regs->esp = old_esp;
13334 + struct T_primsg *it;
13337 + timod_error(fd, T_OPTMGMT_REQ, failed, -error);
13338 + regs->esp = old_esp;
13342 +#if defined(CONFIG_ABI_TRACE)
13343 + abi_trace(ABI_TRACE_STREAMS,
13344 + "optmgmt returns %d bytes, failed=%d\n",
13345 + ret_len, failed);
13348 + /* Convert the return buffer in the user stack to a
13350 + * message and queue it.
13352 + it = timod_mkctl(sizeof(struct T_optmgmt_ack) + ret_len);
13354 + struct T_optmgmt_ack *ack
13355 + = (struct T_optmgmt_ack *)&it->type;
13356 + ack->PRIM_type = T_OPTMGMT_ACK;
13357 + ack->OPT_length = ret_len;
13358 + ack->OPT_offset = sizeof(struct T_optmgmt_ack);
13359 + ack->MGMT_flags = (failed ? T_FAILURE : flag);
13360 + copy_from_user(((char *)ack)+sizeof(struct T_optmgmt_ack),
13361 + ret_base, ret_len);
13362 + it->pri = MSG_HIPRI;
13363 + it->length = sizeof(struct T_optmgmt_ack) + ret_len;
13364 + it->next = Priv(fp)->pfirst;
13365 + Priv(fp)->pfirst = it;
13366 + if (!Priv(fp)->plast)
13367 + Priv(fp)->plast = it;
13368 + timod_socket_wakeup(fp);
13372 + regs->esp = old_esp;
13376 +#else /* no CONFIG_ABI_XTI_OPTMGMT or CONFIG_ABI_TLI_OPTMGMT */
13379 +timod_optmgmt(int fd, struct pt_regs * regs, int flag,
13380 + char * opt_buf, int opt_len, int do_ret)
13385 +#endif /* CONFIG_ABI_XTI_OPTMGMT or CONFIG_ABI_TLI_OPTMGMT */
13387 +#define T_PRIV(fp) Priv(fp)
13390 +timod_update_socket(int fd, struct file * fp, struct pt_regs * regs)
13392 + struct socket * sock;
13393 + struct T_private * priv;
13394 + struct T_primsg * it;
13395 + struct T_conn_ind * ind;
13396 + u_long old_esp, * tsp, alen;
13397 + u_short oldflags;
13400 + sock = SOCKET_I(fp->f_dentry->d_inode);
13401 + priv = T_PRIV(fp);
13404 + * If this a SOCK_STREAM and is in the TS_WRES_CIND state
13405 + * we are supposed to be looking for an incoming connection.
13407 + if (sock->type != SOCK_STREAM || priv->state != TS_WRES_CIND)
13410 + old_esp = regs->esp;
13411 + regs->esp -= 1024;
13412 + tsp = (unsigned long *)regs->esp;
13413 + error = verify_area(VERIFY_WRITE, tsp,
13414 + 3*sizeof(long)+sizeof(struct sockaddr));
13416 + regs->esp = old_esp;
13420 + put_user(fd, tsp);
13421 + put_user((unsigned long)(tsp+4), tsp+1);
13422 + put_user((unsigned long)(tsp+3), tsp+2);
13423 + put_user(sizeof(struct sockaddr), tsp+3);
13426 + * We don't want to block in the accept(). Any
13427 + * blocking necessary must be handled earlier.
13429 + oldflags = fp->f_flags;
13430 + fp->f_flags |= O_NONBLOCK;
13431 + error = sys_socketcall(SYS_ACCEPT, tsp);
13432 + fp->f_flags = oldflags;
13437 + /* The new fd needs to be fixed up
13438 + * with the iBCS file functions and a
13439 + * timod state block.
13441 + inherit_socksys_funcs(error, TS_DATA_XFER);
13443 + /* Generate a T_CONN_IND and queue it. */
13444 + get_user(alen, tsp+3);
13445 + it = timod_mkctl(sizeof(struct T_conn_ind) + alen);
13447 + /* Oops, just drop the connection I guess. */
13448 + sys_close(error);
13452 + ind = (struct T_conn_ind *)&it->type;
13453 + ind->PRIM_type = T_CONN_IND;
13454 + ind->SRC_length = alen;
13455 + ind->SRC_offset = sizeof(struct T_conn_ind);
13456 + ind->OPT_length = ind->OPT_offset = 0;
13457 + ind->SEQ_number = error;
13459 + copy_from_user(((char *)ind)+sizeof(struct T_conn_ind), tsp+4, alen);
13461 + it->pri = MSG_HIPRI;
13463 + it->length = sizeof(struct T_conn_ind) + alen;
13464 + it->next = Priv(fp)->pfirst;
13465 + Priv(fp)->pfirst = it;
13466 + if (!Priv(fp)->plast)
13467 + Priv(fp)->plast = it;
13468 + timod_socket_wakeup(fp);
13471 + regs->esp = old_esp;
13478 +do_getmsg(int fd, struct pt_regs *regs, char *ctl_buf,
13479 + int ctl_maxlen, int *ctl_len, char *dat_buf,
13480 + int dat_maxlen, int *dat_len, int *flags_p)
13484 + unsigned long *tsp;
13485 + unsigned short oldflags;
13486 + struct T_unitdata_ind udi;
13487 + struct file *filep;
13490 + * It may not be obvious but we are always holding an fget(fd)
13491 + * at this point so we can use fcheck(fd) rather than fget...fput.
13493 + filep = fcheck(fd);
13495 + if (!Priv(filep) && Priv(filep)->magic != XTI_MAGIC) {
13496 + printk("putmsg on non-STREAMS fd %d by %s\n",fd, current->comm);
13500 +#if defined(CONFIG_ABI_TRACE)
13501 + abi_trace(ABI_TRACE_STREAMS,
13502 + "getmsg %d, 0x%lx[%d], 0x%lx[%d], %x\n",
13503 + fd, (u_long)ctl_buf, ctl_maxlen,
13504 + (u_long)dat_buf, dat_maxlen, *flags_p);
13508 + * We need some user space to build syscall argument vectors
13509 + * later. Set it up now and page it in if necessary. This will
13510 + * avoid (most?) potential blocking after the select().
13512 + old_esp = regs->esp;
13513 + regs->esp -= 1024;
13514 + tsp = (unsigned long *)regs->esp;
13515 + error = verify_area(VERIFY_WRITE, tsp, 6*sizeof(long));
13516 + regs->esp = old_esp;
13521 + * If the TEP is not non-blocking we must test for
13522 + * something to do. We don't necessarily know what order
13523 + * events will be happening on the socket so we have to
13524 + * watch for evrything at once.
13525 + * N.B. If we weren't asked for data we should only be looking
13526 + * for connection requests. There are socket type issues to
13529 + if (!(filep->f_flags & O_NONBLOCK)) {
13530 + struct poll_wqueues wait_queue;
13531 + poll_table *wait;
13532 + unsigned long mask = (POLLIN | POLLRDNORM | POLLHUP | POLLERR);
13534 + if (*flags_p == MSG_HIPRI)
13537 + poll_initwait(&wait_queue);
13538 + wait = &wait_queue.pt;
13541 + * N.B. We need to be sure to recheck after a schedule()
13542 + * so that when we proceed it is because there is
13543 + * something to do and nothing else can get there
13546 + while (!(filep->f_op->poll(filep, wait) & mask)
13547 + && !signal_pending(current)) {
13548 + current->state = TASK_INTERRUPTIBLE;
13553 + current->state = TASK_RUNNING;
13554 + poll_freewait(&wait_queue);
13556 + if (signal_pending(current))
13560 + if (ctl_maxlen >= 0 && !Priv(filep)->pfirst)
13561 + timod_update_socket(fd, filep, regs);
13564 + * If we were asked for a control part and there is an outstanding
13565 + * message queued as a result of some other operation we'll
13568 + if (ctl_maxlen >= 0 && Priv(filep)->pfirst) {
13569 + int l = ctl_maxlen <= Priv(filep)->pfirst->length
13570 + ? ctl_maxlen : Priv(filep)->pfirst->length;
13571 + error = verify_area(VERIFY_WRITE, ctl_buf, l);
13575 +#if defined(CONFIG_ABI_TRACE)
13576 + abi_trace(ABI_TRACE_STREAMS,
13577 + "priority message %ld %s\n",
13578 + Priv(filep)->pfirst->type,
13579 + xti_prim(Priv(filep)->pfirst->type));
13582 + copy_to_user(ctl_buf, ((char *)&Priv(filep)->pfirst->type)
13583 + + Priv(filep)->offset, l);
13584 + put_user(l, ctl_len);
13585 + if (dat_maxlen >= 0)
13586 + put_user(0, dat_len);
13587 + *flags_p = Priv(filep)->pfirst->pri;
13588 + Priv(filep)->pfirst->length -= l;
13590 +#if defined(CONFIG_ABI_TRACE)
13591 + if (abi_traced(ABI_TRACE_STREAMS) && ctl_buf && l > 0) {
13594 + for (i = 0; i < l && i < 64; i += 4) {
13597 + get_user(v, (u_long *)(ctl_buf + i));
13598 + __abi_trace("ctl: 0x%08lx\n", v);
13601 + __abi_trace("ctl: ...\n");
13605 + if (Priv(filep)->pfirst->length) {
13606 + Priv(filep)->offset += l;
13608 +#if defined(CONFIG_ABI_TRACE)
13609 + abi_trace(ABI_TRACE_STREAMS,
13610 + "MORECTL %d bytes",
13611 + Priv(filep)->pfirst->length);
13615 + struct T_primsg *it = Priv(filep)->pfirst;
13616 + Priv(filep)->pfirst = it->next;
13617 + if (!Priv(filep)->pfirst)
13618 + Priv(filep)->plast = NULL;
13620 + Priv(filep)->offset = 0;
13627 + /* If we weren't asked for data there is nothing more to do. */
13628 + if (dat_maxlen <= 0) {
13629 + if (dat_maxlen == 0)
13630 + put_user(0, dat_len);
13631 + if (ctl_maxlen >= 0)
13632 + put_user(0, ctl_len);
13636 + /* If the select() slept we may have had our temp space paged
13637 + * out. The re-verify_area is only really needed for pre-486
13638 + * chips which don't handle write faults from kernel mode.
13640 + regs->esp = (unsigned long)tsp;
13641 + error = verify_area(VERIFY_WRITE, tsp, 6*sizeof(long));
13643 + regs->esp = old_esp;
13646 + put_user(fd, tsp);
13647 + put_user((unsigned long)dat_buf, tsp+1);
13648 + put_user((dat_maxlen < 0 ? 0 : dat_maxlen), tsp+2);
13649 + put_user(0, tsp+3);
13650 + if (ctl_maxlen > (int)sizeof(udi) && Priv(filep)->state == TS_IDLE) {
13651 + put_user((unsigned long)ctl_buf+sizeof(udi), tsp+4);
13652 + put_user(ctl_maxlen-sizeof(udi), ctl_len);
13653 + put_user((int)ctl_len, tsp+5);
13655 + put_user(0, tsp+4);
13656 + put_user(0, ctl_len);
13657 + put_user((int)ctl_len, tsp+5);
13660 + /* We don't want to block in the recvfrom(). Any blocking is
13661 + * handled by the select stuff above.
13663 + oldflags = filep->f_flags;
13664 + filep->f_flags |= O_NONBLOCK;
13665 + error = sys_socketcall(SYS_RECVFROM, tsp);
13666 + filep->f_flags = oldflags;
13668 + regs->esp = old_esp;
13672 + && ctl_maxlen > (int)sizeof(udi)
13673 + && Priv(filep)->state == TS_IDLE) {
13674 + udi.PRIM_type = T_UNITDATA_IND;
13675 + get_user(udi.SRC_length, ctl_len);
13676 + udi.SRC_offset = sizeof(udi);
13677 + udi.OPT_length = udi.OPT_offset = 0;
13678 + copy_to_user(ctl_buf, &udi, (int)sizeof(udi));
13679 + put_user(sizeof(udi)+udi.SRC_length, ctl_len);
13681 +#if defined(CONFIG_ABI_TRACE)
13682 + if (abi_traced(ABI_TRACE_STREAMS) &&
13683 + ctl_buf && udi.SRC_length > 0) {
13684 + char * buf = ctl_buf + sizeof(udi);
13687 + for (i = 0; i < udi.SRC_length &&
13688 + i < 64; i += 4) {
13691 + get_user(v, (u_long *)(buf+i));
13692 + __abi_trace("dat: 0x%08lx\n", v);
13694 + if (i != udi.SRC_length)
13695 + __abi_trace("dat: ...\n");
13700 + put_user(0, ctl_len);
13702 + put_user(error, dat_len);
13709 +do_putmsg(int fd, struct pt_regs *regs, char *ctl_buf, int ctl_len,
13710 + char *dat_buf, int dat_len, int flags)
13712 + struct file *filep;
13713 + int error, terror;
13714 + unsigned long cmd;
13716 + /* It may not be obvious but we are always holding an fget(fd)
13717 + * at this point so we can use fcheck(fd) rather than fget...fput.
13719 + filep = fcheck(fd);
13721 + if (!Priv(filep) && Priv(filep)->magic != XTI_MAGIC) {
13722 + printk("putmsg on non-STREAMS fd %d by %s\n",fd, current->comm);
13726 +#if defined(CONFIG_ABI_TRACE)
13727 + if (abi_traced(ABI_TRACE_STREAMS)) {
13729 + __abi_trace("putmsg %d, 0x%lx[%d], 0x%lx[%d], %x\n",
13730 + fd, (u_long)ctl_buf, ctl_len,
13731 + (u_long)dat_buf, dat_len, flags);
13733 + get_user(v, ctl_buf);
13734 + __abi_trace("putmsg prim: %ld %s\n", v, xti_prim(v));
13736 + if (ctl_buf && ctl_len > 0) {
13739 + for (i = 0; i < ctl_len && i < 64; i += 4) {
13742 + get_user(v, (u_long *)(ctl_buf + i));
13743 + __abi_trace("ctl: 0x%08lx\n", v);
13745 + if (i != ctl_len)
13746 + __abi_trace("ctl: ...\n");
13749 + if (dat_buf && dat_len > 0) {
13752 + for (i = 0; i < dat_len && i < 64; i += 4) {
13755 + get_user(v, (u_long *)(dat_buf + i));
13756 + __abi_trace("dat: 0x%08lx\n", v);
13758 + if (i != dat_len)
13759 + __abi_trace("dat: ...");
13764 + error = get_user(cmd, (unsigned long *)ctl_buf);
13769 + case T_BIND_REQ: {
13770 + struct T_bind_req req;
13772 + unsigned long *tsp;
13774 +#if defined(CONFIG_ABI_TRACE)
13775 + abi_trace(ABI_TRACE_STREAMS, "%u bind req\n", fd);
13777 + error = verify_area(VERIFY_READ, ctl_buf, sizeof(req));
13781 + if (Priv(filep)->state != TS_UNBND) {
13782 + timod_error(fd, T_BIND_REQ, TOUTSTATE, 0);
13786 + old_esp = regs->esp;
13787 + regs->esp -= 1024;
13788 + tsp = (unsigned long *)(regs->esp);
13789 + error = verify_area(VERIFY_WRITE, tsp, 3*sizeof(long));
13791 + timod_error(fd, T_BIND_REQ, TSYSERR, -error);
13792 + regs->esp = old_esp;
13796 + copy_from_user(&req, ctl_buf, sizeof(req));
13797 + if (req.ADDR_offset && req.ADDR_length) {
13798 + struct sockaddr_in *sin;
13799 + unsigned short family;
13801 +#if 1 /* Wheee... Kludge time... */
13802 + sin = (struct sockaddr_in *)(ctl_buf
13803 + + req.ADDR_offset);
13804 + get_user(family, &sin->sin_family);
13806 + /* Sybase seems to have set up the address
13807 + * struct with sa->sa_family = htons(AF_?)
13808 + * which is bollocks. I have no idea why it
13809 + * apparently works on SCO?!?
13811 + if (family && !(family & 0x00ff))
13812 + put_user(ntohs(family), &sin->sin_family);
13815 + put_user(fd, tsp);
13816 + put_user((unsigned long)ctl_buf
13817 + + req.ADDR_offset, tsp+1);
13818 + /* For TLI/XTI the length may be the 8 *used*
13819 + * bytes, for (IP?) sockets it must be the 16
13820 + * *total* bytes in a sockaddr_in.
13822 + put_user(req.ADDR_length == 8
13823 + ? 16 : req.ADDR_length,
13825 + error = sys_socketcall(SYS_BIND, tsp);
13828 + if (req.CONIND_number) {
13830 +#if defined(CONFIG_ABI_TRACE)
13831 + abi_trace(ABI_TRACE_STREAMS,
13832 + "%u listen backlog=%lu\n",
13833 + fd, req.CONIND_number);
13836 + put_user(fd, tsp);
13837 + put_user(req.CONIND_number, tsp+1);
13838 + sys_socketcall(SYS_LISTEN, tsp);
13839 + Priv(filep)->state = TS_WRES_CIND;
13841 + Priv(filep)->state = TS_IDLE;
13848 + regs->esp = old_esp;
13851 + struct T_primsg *it;
13852 + it = timod_mkctl(ctl_len);
13854 + struct T_bind_ack *ack = (struct T_bind_ack *)&it->type;
13855 + copy_from_user(ack, ctl_buf, ctl_len);
13856 + ack->PRIM_type = T_BIND_ACK;
13857 + it->pri = MSG_HIPRI;
13858 + it->length = ctl_len;
13860 + timod_ok(fd, T_BIND_REQ);
13861 + Priv(filep)->plast->next = it;
13862 + Priv(filep)->plast = it;
13868 + terror = TOUTSTATE;
13875 + case -EADDRNOTAVAIL:
13876 + case -EADDRINUSE:
13877 + terror = TNOADDR;
13881 + terror = TSYSERR;
13884 + timod_error(fd, T_BIND_REQ, terror, -error);
13887 + case T_CONN_RES: {
13888 + struct T_conn_res *res = (struct T_conn_res *)ctl_buf;
13889 + unsigned int conn_fd;
13891 + error = get_user(conn_fd, &res->SEQ_number);
13895 +#if defined(CONFIG_ABI_TRACE)
13896 + abi_trace(ABI_TRACE_STREAMS,
13897 + "%u accept: conn fd=%u, use fd=%u\n",
13898 + fd, conn_fd, flags);
13901 + if (conn_fd != flags) {
13902 + error = sys_dup2(conn_fd, flags);
13903 + sys_close(conn_fd);
13907 + timod_ok(fd, T_CONN_RES);
13910 + case T_CONN_REQ: {
13911 + struct T_conn_req req;
13913 + unsigned short oldflags;
13914 + unsigned long *tsp;
13915 + struct T_primsg *it;
13916 + struct sockaddr_in *sin;
13917 + unsigned short family;
13919 +#if defined(CONFIG_ABI_TRACE)
13920 + abi_trace(ABI_TRACE_STREAMS, "%u connect req\n", fd);
13922 + error = verify_area(VERIFY_READ, ctl_buf, sizeof(req));
13926 + if (Priv(filep)->state != TS_UNBND
13927 + && Priv(filep)->state != TS_IDLE) {
13928 + timod_error(fd, T_CONN_REQ, TOUTSTATE, 0);
13932 + old_esp = regs->esp;
13933 + regs->esp -= 1024;
13934 + tsp = (unsigned long *)(regs->esp);
13935 + error = verify_area(VERIFY_WRITE, tsp, 3*sizeof(long));
13937 + timod_error(fd, T_CONN_REQ, TSYSERR, -error);
13938 + regs->esp = old_esp;
13941 + copy_from_user(&req, ctl_buf, sizeof(req));
13942 + put_user(fd, tsp);
13943 + put_user((unsigned long)ctl_buf + req.DEST_offset, tsp+1);
13944 + /* For TLI/XTI the length may be the 8 *used*
13945 + * bytes, for (IP?) sockets it must be the 16
13946 + * *total* bytes in a sockaddr_in.
13948 + put_user(req.DEST_length == 8
13949 + ? 16 : req.DEST_length,
13952 +#if 1 /* Wheee... Kludge time... */
13953 + sin = (struct sockaddr_in *)(ctl_buf
13954 + + req.DEST_offset);
13955 + get_user(family, &sin->sin_family);
13957 + /* Sybase seems to have set up the address
13958 + * struct with sa->sa_family = htons(AF_?)
13959 + * which is bollocks. I have no idea why it
13960 + * apparently works on SCO?!?
13962 + if (family && !(family & 0x00ff)) {
13963 + family = ntohs(family);
13964 + put_user(family, &sin->sin_family);
13967 + /* Sheesh... ISC telnet seems to give the port
13968 + * number low byte first as I expected but the
13969 + * X programs seem to be giving high byte first.
13970 + * One is broken of course but clearly both
13971 + * should work. No, I don't understand this
13972 + * either but I can at least try...
13973 + * A better solution would be for you to change
13974 + * the definition of xserver0 in ISC's /etc/services
13975 + * but then it wouldn't work out of the box...
13977 + if (is_cur_personality(PER_SVR4) && family == AF_INET) {
13978 + get_user(family, &sin->sin_port);
13979 + if (family == 0x1770)
13980 + put_user(htons(family),
13984 + /* FIXME: We should honour non-blocking mode
13985 + * here but that means that the select probe
13986 + * needs to know that if select returns ok and
13987 + * we are in T_OUTCON we have a connection
13988 + * completion. This isn't so bad but the real
13989 + * problem is that the connection acknowledgement
13990 + * is supposed to contain the destination
13993 + oldflags = filep->f_flags;
13994 + filep->f_flags &= ~O_NONBLOCK;
13995 + error = sys_socketcall(SYS_CONNECT, tsp);
13996 + filep->f_flags = oldflags;
13997 + regs->esp = old_esp;
14000 + struct T_conn_con *con;
14002 + it = timod_mkctl(ctl_len);
14005 + it->length = ctl_len;
14006 + con = (struct T_conn_con *)&it->type;
14007 + copy_from_user(con, ctl_buf, ctl_len);
14008 + con->PRIM_type = T_CONN_CON;
14009 + Priv(filep)->state = TS_DATA_XFER;
14011 + struct T_discon_ind *dis;
14013 +#if defined(CONFIG_ABI_TRACE)
14014 + abi_trace(ABI_TRACE_STREAMS,
14015 + "%u connect failed (errno=%d)\n",
14019 + it = timod_mkctl(sizeof(struct T_discon_ind));
14022 + it->length = sizeof(struct T_discon_ind);
14023 + dis = (struct T_discon_ind *)&it->type;
14024 + dis->PRIM_type = T_DISCON_IND;
14025 + dis->DISCON_reason = iABI_errors(-error);
14026 + dis->SEQ_number = 0;
14028 + timod_ok(fd, T_CONN_REQ);
14031 + Priv(filep)->plast->next = it;
14032 + Priv(filep)->plast = it;
14036 + case T_DISCON_REQ: {
14037 + struct T_discon_req *req;
14039 + req = (struct T_discon_req *)ctl_buf;
14040 + error = get_user(fd, &req->SEQ_number);
14044 +#if defined(CONFIG_ABI_TRACE)
14045 + abi_trace(ABI_TRACE_STREAMS, "disconnect %u\n", fd);
14047 + /* Fall through... */
14049 + case T_ORDREL_REQ: {
14054 + case T_DATA_REQ: {
14056 + unsigned long *tsp;
14058 +#if defined(CONFIG_ABI_TRACE)
14059 + abi_trace(ABI_TRACE_STREAMS, "%u data req\n", fd);
14062 + if (Priv(filep)->state != TS_DATA_XFER) {
14066 + old_esp = regs->esp;
14067 + regs->esp -= 1024;
14068 + tsp = (unsigned long *)(regs->esp);
14069 + error = verify_area(VERIFY_WRITE, tsp, 6*sizeof(long));
14071 + regs->esp = old_esp;
14074 + put_user(fd, tsp);
14075 + put_user((unsigned long)dat_buf, tsp+1);
14076 + put_user(dat_len, tsp+2);
14077 + put_user(0, tsp+3);
14078 + error = sys_socketcall(SYS_SEND, tsp);
14079 + regs->esp = old_esp;
14083 + case T_UNITDATA_REQ: {
14084 + struct T_unitdata_req req;
14086 + unsigned long *tsp;
14088 +#if defined(CONFIG_ABI_TRACE)
14089 + abi_trace(ABI_TRACE_STREAMS, "%u unitdata req\n", fd);
14091 + error = verify_area(VERIFY_READ, ctl_buf, sizeof(req));
14095 + if (Priv(filep)->state != TS_IDLE
14096 + && Priv(filep)->state != TS_DATA_XFER) {
14097 + timod_error(fd, T_UNITDATA_REQ, TOUTSTATE, 0);
14101 + old_esp = regs->esp;
14102 + regs->esp -= 1024;
14103 + tsp = (unsigned long *)(regs->esp);
14104 + error = verify_area(VERIFY_WRITE, tsp, 6*sizeof(long));
14106 + timod_error(fd, T_UNITDATA_REQ, TSYSERR, -error);
14107 + regs->esp = old_esp;
14110 + put_user(fd, tsp);
14111 + put_user((unsigned long)dat_buf, tsp+1);
14112 + put_user(dat_len, tsp+2);
14113 + put_user(0, tsp+3);
14114 + copy_from_user(&req, ctl_buf, sizeof(req));
14115 + if (req.DEST_length > 0) {
14116 + put_user((unsigned long)(ctl_buf+req.DEST_offset), tsp+4);
14117 + put_user(req.DEST_length, tsp+5);
14118 + error = sys_socketcall(SYS_SENDTO, tsp);
14119 + regs->esp = old_esp;
14122 + error = sys_socketcall(SYS_SEND, tsp);
14123 + regs->esp = old_esp;
14127 + case T_UNBIND_REQ:
14128 + Priv(filep)->state = TS_UNBND;
14129 + timod_ok(fd, T_UNBIND_REQ);
14132 + case T_OPTMGMT_REQ: {
14133 + struct T_optmgmt_req req;
14135 +#if defined(CONFIG_ABI_TRACE)
14136 + abi_trace(ABI_TRACE_STREAMS, "%u optmgmt req\n", fd);
14138 + error = verify_area(VERIFY_READ, ctl_buf, sizeof(req));
14141 + copy_from_user(&req, ctl_buf, sizeof(req));
14143 + return timod_optmgmt(fd, regs, req.MGMT_flags,
14144 + req.OPT_offset > 0
14145 + ? ctl_buf+req.OPT_offset
14152 +#if defined(CONFIG_ABI_TRACE)
14153 + if (abi_traced(ABI_TRACE_STREAMS))
14156 + if (ctl_buf && ctl_len > 0) {
14159 + for (i = 0; i < ctl_len && i < 32; i += 4) {
14162 + get_user(v, (u_long *)(ctl_buf + i));
14163 + __abi_trace("ctl: 0x%08lx\n", v);
14165 + if (i != ctl_len)
14166 + __abi_trace("ctl: ...\n");
14168 + if (dat_buf && dat_len > 0) {
14170 + for (i = 0; i < dat_len && i < 32; i += 4) {
14173 + get_user(v, (u_long *)(dat_buf + i));
14174 + __abi_trace("dat: 0x%08lx\n", v);
14176 + if (i != dat_len)
14177 + __abi_trace("dat: ...\n");
14184 +/* this function needs to be cleaned up badly. --hch */
14186 +timod_ioctl(struct pt_regs *regs,
14187 + int fd, unsigned int func, void *arg, int len, int *len_p)
14189 + struct file *filep;
14190 + struct inode *ino;
14195 + filep = fget(fd);
14199 + error = verify_area(VERIFY_WRITE, len_p, sizeof(int));
14202 + return (-error << 8) | TSYSERR;
14205 + ino = filep->f_dentry->d_inode;
14207 + /* SCO/SVR3 starts at 100, ISC/SVR4 starts at 140. */
14208 + switch (func >= 140 ? func-140 : func-100) {
14209 + case 0: /* TI_GETINFO */
14211 + struct T_info_ack it;
14214 +#if defined(CONFIG_ABI_TRACE)
14215 + abi_trace(ABI_TRACE_STREAMS, "%u getinfo\n", fd);
14217 + /* The pre-SVR4 T_info_ack structure didn't have
14218 + * the PROVIDER_flag on the end.
14220 + error = verify_area(VERIFY_WRITE, arg,
14222 + ? sizeof(struct T_info_ack)
14223 + : sizeof(struct T_info_ack)-sizeof(long));
14226 + return (-error << 8) | TSYSERR;
14229 + __get_user(v, &((struct T_info_req *)arg)->PRIM_type);
14230 + if (v != T_INFO_REQ) {
14232 + return (EINVAL << 8) | TSYSERR;
14235 + it.PRIM_type = T_INFO_ACK;
14236 + it.CURRENT_state = Priv(filep)->state;
14237 + it.CDATA_size = -2;
14238 + it.DDATA_size = -2;
14239 + it.OPT_size = -1;
14240 + it.TIDU_size = 16384;
14241 + switch ((MINOR(ino->i_rdev)>>4) & 0x0f) {
14243 + it.ADDR_size = sizeof(struct sockaddr_un);
14246 + it.ADDR_size = sizeof(struct sockaddr_in);
14249 + /* Uh... dunno... play safe(?) */
14250 + it.ADDR_size = 1024;
14253 + switch (SOCKET_I(ino)->type) {
14254 + case SOCK_STREAM:
14255 + it.ETSDU_size = 1;
14256 + it.TSDU_size = 0;
14257 + it.SERV_type = 2;
14260 + it.ETSDU_size = -2;
14261 + it.TSDU_size = 16384;
14262 + it.SERV_type = 3;
14268 + /* The pre-SVR4 T_info_ack structure didn't have
14269 + * the PROVIDER_flag on the end.
14271 + if (func == 140) {
14272 + it.PROVIDER_flag = 0;
14273 + copy_to_user(arg, &it, sizeof(it));
14274 + put_user(sizeof(it), len_p);
14277 + copy_to_user(arg, &it, sizeof(it)-sizeof(long));
14278 + put_user(sizeof(it)-sizeof(long), len_p);
14282 + case 2: /* TI_BIND */
14287 +#if defined(CONFIG_ABI_TRACE)
14288 + abi_trace(ABI_TRACE_STREAMS, "%u bind\n", fd);
14290 + error = do_putmsg(fd, regs, arg, len,
14294 + return (-error << 8) | TSYSERR;
14297 + /* Get the response. This should be either
14298 + * T_OK_ACK or T_ERROR_ACK.
14301 + error = do_getmsg(fd, regs,
14307 + return (-error << 8) | TSYSERR;
14310 + get_user(prim, (unsigned long *)arg);
14311 + if (prim == T_ERROR_ACK) {
14312 + unsigned long a, b;
14314 + get_user(a, ((unsigned long *)arg)+3);
14315 + get_user(b, ((unsigned long *)arg)+2);
14316 + return (a << 8) | b;
14318 + if (prim != T_OK_ACK) {
14323 + /* Get the response to the bind request. */
14325 + error = do_getmsg(fd, regs,
14331 + return (-error << 8) | TSYSERR;
14336 + case 3: /* TI_UNBIND */
14337 + if (Priv(filep)->state != TS_IDLE) {
14339 + return TOUTSTATE;
14341 + Priv(filep)->state = TS_UNBND;
14345 + case 1: { /* TI_OPTMGMT */
14346 +#if defined(CONFIG_ABI_XTI_OPTMGMT) || defined(CONFIG_ABI_TLI_OPTMGMT)
14350 +#if defined(CONFIG_ABI_TRACE)
14351 + abi_trace(ABI_TRACE_STREAMS, "%u optmgmt\n", fd);
14353 + error = do_putmsg(fd, regs, arg, len,
14357 + return (-error << 8) | TSYSERR;
14360 + /* Get the response to the optmgmt request. */
14362 + error = do_getmsg(fd, regs,
14367 + /* If there is excess data in the response
14368 + * our buffer is too small which implies
14369 + * the application is broken. SO_LINGER
14370 + * is a common fault. Because it works
14371 + * on other systems we attempt to recover
14372 + * by discarding the excess.
14374 + struct T_primsg *it = Priv(filep)->pfirst;
14375 + Priv(filep)->pfirst = it->next;
14376 + if (!Priv(filep)->pfirst)
14377 + Priv(filep)->plast = NULL;
14379 + Priv(filep)->offset = 0;
14381 +#if defined(CONFIG_ABI_TRACE)
14382 + abi_trace(ABI_TRACE_STREAMS,
14383 + "excess discarded\n");
14390 + return (-error << 8) | TSYSERR;
14392 + __get_user(prim, (unsigned long *)arg);
14393 + if (prim == T_ERROR_ACK) {
14394 + unsigned long a, b;
14395 + __get_user(a, ((unsigned long *)arg)+3);
14396 + __get_user(b, ((unsigned long *)arg)+2);
14397 + return (a << 8) | b;
14401 +#else /* no CONFIG_ABI_XTI_OPTMGMT or CONFIG_ABI_TLI_OPTMGMT */
14403 + return TNOTSUPPORT;
14404 +#endif /* CONFIG_ABI_XTI_OPTMGMT or CONFIG_ABI_TLI_OPTMGMT */
14407 + case 4: /* TI_GETMYNAME */
14408 + case 5: /* TI_SETPEERNAME */
14409 + case 6: /* TI_GETMYNAME */
14410 + case 7: /* TI_SETPEERNAME */
14414 +#if defined(CONFIG_ABI_TRACE)
14415 + abi_trace(ABI_TRACE_STREAMS,
14416 + "STREAMS timod op %d not supported\n", func);
14419 + return TNOTSUPPORT;
14424 +svr4_sockmod_ioctl(int fd, u_int cmd, caddr_t data)
14427 + struct inode *ip;
14434 + ip = fp->f_dentry->d_inode;
14435 + if (MAJOR(ip->i_rdev) == SOCKSYS_MAJOR) {
14436 + error = socksys_fdinit(fd, 0, NULL, NULL);
14443 + ip = fp->f_dentry->d_inode;
14447 + case 101: { /* SI_GETUDATA */
14449 + int tidusize, addrsize, optsize, etsdusize;
14450 + int servtype, so_state, so_options;
14451 + } *it = (void *)data;
14453 +#if defined(CONFIG_ABI_TRACE)
14454 + abi_trace(ABI_TRACE_STREAMS, "%u getudata\n", fd);
14456 + error = verify_area(VERIFY_WRITE, it, sizeof(*it));
14459 + return (-error << 8) | TSYSERR;
14462 + __put_user(16384, &it->tidusize);
14463 + __put_user(sizeof(struct sockaddr), &it->addrsize);
14464 + __put_user(-1, &it->optsize);
14465 + __put_user(0, &it->so_state);
14466 + __put_user(0, &it->so_options);
14468 + switch (SOCKET_I(ip)->type) {
14469 + case SOCK_STREAM:
14470 + __put_user(1, &it->etsdusize);
14471 + __put_user(2, &it->servtype);
14474 + __put_user(-2, &it->etsdusize);
14475 + __put_user(3, &it->servtype);
14482 + case 102: /* SI_SHUTDOWN */
14483 + case 103: /* SI_LISTEN */
14484 + case 104: /* SI_SETMYNAME */
14485 + case 105: /* SI_SETPEERNAME */
14486 + case 106: /* SI_GETINTRANSIT */
14487 + case 107: /* SI_TCL_LINK */
14488 + case 108: /* SI_TCL_UNLINK */
14492 +#if defined(CONFIG_ABI_TRACE)
14493 + abi_trace(ABI_TRACE_STREAMS,
14494 + "STREAMS sockmod op %d not supported\n", cmd);
14497 + return TNOTSUPPORT;
14500 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
14501 +EXPORT_SYMBOL(svr4_sockmod_ioctl);
14503 diff -Nru linux-2.6.7/abi/util/Makefile linux-2.6.7-abi/abi/util/Makefile
14504 --- linux-2.6.7/abi/util/Makefile 1970-01-01 01:00:00.000000000 +0100
14505 +++ linux-2.6.7-abi/abi/util/Makefile 2004-07-22 17:44:21.000000000 +0200
14508 +abi-util-objs := stat.o plist.o
14510 +obj-$(CONFIG_ABI_UTIL) += abi-util.o
14512 +abi-util.o: $(abi-util-objs)
14513 + $(LD) -r -o $@ $(abi-util-objs)
14514 diff -Nru linux-2.6.7/abi/util/plist.c linux-2.6.7-abi/abi/util/plist.c
14515 --- linux-2.6.7/abi/util/plist.c 1970-01-01 01:00:00.000000000 +0100
14516 +++ linux-2.6.7-abi/abi/util/plist.c 2004-07-22 17:44:21.000000000 +0200
14520 +#include <linux/string.h>
14521 +#include <linux/fs.h>
14522 +#include <linux/slab.h> /* needed by putname macro */
14523 +#include <linux/sched.h> /* needed by current-> in __abi_trace() macro */
14524 +#include <linux/module.h>
14526 +#include <abi/util/trace.h>
14529 +#if defined(CONFIG_ABI_TRACE)
14531 +print_string(char *buf, char *str)
14535 + tmp = getname(str);
14536 + if (!IS_ERR(tmp)) {
14537 + /* we are debugging, we don't need to see it all */
14539 + sprintf(buf, "\"%s\"", tmp);
14544 +void plist(char *name, char *args, int *list)
14546 + char buf[512], *p = buf;
14550 + switch (*args++) {
14552 + sprintf(p, "%d", *list++);
14555 + sprintf(p, "0%o", *list++);
14558 + sprintf(p, "%p", (void *)(*list++));
14562 + sprintf(p, "0x%x", *list++);
14565 + print_string(p, (char *)(*list++));
14568 + sprintf(p, "?%c%c?", '%', args[-1]);
14580 + __abi_trace("%s(%s)\n", name, buf);
14583 +#if CONFIG_ABI_LCALL7 == m
14584 +EXPORT_SYMBOL(plist);
14586 +#endif /* CONFIG_ABI_TRACE */
14587 diff -Nru linux-2.6.7/abi/util/stat.c linux-2.6.7-abi/abi/util/stat.c
14588 --- linux-2.6.7/abi/util/stat.c 1970-01-01 01:00:00.000000000 +0100
14589 +++ linux-2.6.7-abi/abi/util/stat.c 2004-07-22 17:44:21.000000000 +0200
14592 + * Mostly ripped from Al Viro's stat-a-AC9-10 patch, 2001 Christoph Hellwig.
14597 +#include <linux/module.h> /* needed to shut up modprobe */
14598 +#include <linux/fs.h>
14599 +#include <linux/stat.h>
14600 +#include <linux/sched.h>
14601 +#include <linux/file.h>
14602 +#include <linux/namei.h>
14604 +#include <abi/util/revalidate.h>
14605 +#include <abi/util/stat.h>
14608 +MODULE_DESCRIPTION("Linux-ABI helper routines");
14609 +MODULE_AUTHOR("Christoph Hellwig, ripped from kernel sources/patches");
14610 +MODULE_LICENSE("GPL");
14612 +#if 0 /* LINUXABI_OBSOLETE */
14613 +int getattr_full(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
14615 + struct inode *inode = dentry->d_inode;
14616 + stat->dev = inode->i_rdev;
14617 + stat->ino = inode->i_ino;
14618 + stat->mode = inode->i_mode;
14619 + stat->nlink = inode->i_nlink;
14620 + stat->uid = inode->i_uid;
14621 + stat->gid = inode->i_gid;
14622 + stat->rdev = inode->i_rdev;
14623 + stat->atime = inode->i_atime;
14624 + stat->mtime = inode->i_mtime;
14625 + stat->ctime = inode->i_ctime;
14626 + stat->size = inode->i_size;
14627 + stat->blocks = inode->i_blocks;
14628 + stat->blksize = inode->i_blksize;
14633 + * Use minix fs values for the number of direct and indirect blocks. The
14634 + * count is now exact for the minix fs except that it counts zero blocks.
14635 + * Everything is in units of BLOCK_SIZE until the assignment to
14638 +int getattr_minix(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
14640 + struct inode *inode = dentry->d_inode;
14641 + unsigned int blocks, indirect;
14643 + stat->dev = inode->i_rdev;
14644 + stat->ino = inode->i_ino;
14645 + stat->mode = inode->i_mode;
14646 + stat->nlink = inode->i_nlink;
14647 + stat->uid = inode->i_uid;
14648 + stat->gid = inode->i_gid;
14649 + stat->rdev = inode->i_rdev;
14650 + stat->atime = inode->i_atime;
14651 + stat->mtime = inode->i_mtime;
14652 + stat->ctime = inode->i_ctime;
14653 + stat->size = inode->i_size;
14655 +#define I_B (BLOCK_SIZE / sizeof(unsigned short))
14657 + blocks = (stat->size + BLOCK_SIZE - 1) >> BLOCK_SIZE_BITS;
14658 + if (blocks > D_B) {
14659 + indirect = (blocks - D_B + I_B - 1) / I_B;
14660 + blocks += indirect;
14661 + if (indirect > 1) {
14662 + indirect = (indirect - 1 + I_B - 1) / I_B;
14663 + blocks += indirect;
14664 + if (indirect > 1)
14668 + stat->blocks = (BLOCK_SIZE / 512) * blocks;
14669 + stat->blksize = BLOCK_SIZE;
14673 +int vfs_stat(char *filename, struct kstat *stat)
14675 + struct nameidata nd;
14678 + error = user_path_walk(filename, &nd);
14682 + error = do_revalidate(nd.dentry);
14684 + struct inode *inode = nd.dentry->d_inode;
14685 + if (!inode->i_blksize)
14686 + error = getattr_minix(nd.mnt, nd.dentry, stat);
14688 + error = getattr_full(nd.mnt, nd.dentry, stat);
14689 + path_release(&nd);
14695 +int vfs_lstat(char *filename, struct kstat *stat)
14697 + struct nameidata nd;
14700 + error = user_path_walk_link(filename, &nd);
14704 + error = do_revalidate(nd.dentry);
14706 + struct inode *inode = nd.dentry->d_inode;
14707 + if (!inode->i_blksize)
14708 + error = getattr_minix(nd.mnt, nd.dentry, stat);
14710 + error = getattr_full(nd.mnt, nd.dentry, stat);
14711 + path_release(&nd);
14717 +int vfs_fstat(int fd, struct kstat *stat)
14719 + struct file *file = fget(fd);
14725 + error = do_revalidate(file->f_dentry);
14727 + struct inode *inode = file->f_dentry->d_inode;
14728 + if (!inode->i_blksize)
14729 + error = getattr_minix(file->f_vfsmnt, file->f_dentry, stat);
14731 + error = getattr_full(file->f_vfsmnt, file->f_dentry, stat);
14737 diff -Nru linux-2.6.7/abi/uw7/access.c linux-2.6.7-abi/abi/uw7/access.c
14738 --- linux-2.6.7/abi/uw7/access.c 1970-01-01 01:00:00.000000000 +0100
14739 +++ linux-2.6.7-abi/abi/uw7/access.c 2004-07-22 17:44:21.000000000 +0200
14742 + * abi/uw7/access.c - support for UnixWare access(2) system call.
14744 + * We handle the non-POSIX EFF_ONLY_OK/EX_OK flags.
14745 + * This software is under GPL.
14748 +#include <linux/errno.h>
14749 +#include <linux/sched.h>
14750 +#include <linux/syscalls.h>
14751 +#include <linux/dcache.h>
14752 +#include <linux/namei.h>
14753 +#include <asm/uaccess.h>
14755 +#include <abi/util/revalidate.h>
14761 +#define DBG(x...) printk(x)
14766 +#define UW7_R_OK 004
14767 +#define UW7_W_OK 002
14768 +#define UW7_X_OK 001
14769 +#define UW7_F_OK 000
14770 +#define UW7_EFF_ONLY_OK 010
14771 +#define UW7_EX_OK 020
14773 +#define UW7_MODE_MSK (UW7_R_OK|UW7_W_OK|UW7_X_OK|UW7_F_OK|UW7_EFF_ONLY_OK|UW7_EX_OK)
14775 +int uw7_access(char * filename, int mode)
14777 + struct nameidata nd;
14780 + DBG(KERN_ERR "UW7[%d]: access(%p,%o)\n", current->pid, filename, mode);
14782 + if (mode & ~UW7_MODE_MSK)
14785 + if (mode & UW7_EX_OK) {
14786 + error = user_path_walk(filename, &nd);
14788 + error = do_revalidate(nd.dentry);
14790 + path_release(&nd);
14793 + if (!S_ISREG(nd.dentry->d_inode->i_mode)) {
14794 + path_release(&nd);
14797 + path_release(&nd);
14799 + mode &= ~UW7_EX_OK;
14800 + mode |= UW7_X_OK;
14802 + if (mode & UW7_EFF_ONLY_OK) {
14803 + uid_t old_uid = current->uid, old_gid = current->gid;
14805 + current->uid = current->euid;
14806 + current->gid = current->egid;
14807 + mode &= ~UW7_EFF_ONLY_OK;
14808 + error = sys_access(filename, mode);
14809 + current->uid = old_uid;
14810 + current->gid = old_gid;
14812 + error = sys_access(filename, mode);
14816 diff -Nru linux-2.6.7/abi/uw7/context.c linux-2.6.7-abi/abi/uw7/context.c
14817 --- linux-2.6.7/abi/uw7/context.c 1970-01-01 01:00:00.000000000 +0100
14818 +++ linux-2.6.7-abi/abi/uw7/context.c 2004-07-22 17:44:21.000000000 +0200
14821 + * abi/uw7/context.c
14823 + * This software is under GPL
14827 +#include <linux/ptrace.h>
14828 +#include <linux/errno.h>
14829 +#define __KERNEL_SYSCALLS__
14830 +#include <linux/unistd.h>
14831 +#include <linux/syscalls.h>
14832 +#include <asm/uaccess.h>
14834 +#include <asm/abi_machdep.h>
14835 +#include <abi/uw7/context.h>
14839 +uw7_sigaltstack(const uw7_stack_t *uw7_ss, uw7_stack_t *uw7_oss)
14841 + stack_t ss, oss, *ssp = NULL, *ossp = NULL;
14843 + mm_segment_t old_fs;
14846 + error = verify_area(VERIFY_READ, uw7_ss, sizeof(uw7_stack_t));
14849 + __get_user(ss.ss_sp, &uw7_ss->ss_sp);
14850 + __get_user(ss.ss_size, &uw7_ss->ss_size);
14851 + __get_user(ss.ss_flags, &uw7_ss->ss_flags);
14856 + error = verify_area(VERIFY_WRITE, uw7_oss, sizeof(uw7_stack_t));
14859 + __get_user(oss.ss_sp, &uw7_oss->ss_sp);
14860 + __get_user(oss.ss_size, &uw7_oss->ss_size);
14861 + __get_user(oss.ss_flags, &uw7_oss->ss_flags);
14865 + old_fs = get_fs();
14866 + set_fs(get_ds());
14867 + error = sys_sigaltstack(ssp, ossp);
14871 + __put_user(ossp->ss_sp, &uw7_oss->ss_sp);
14872 + __put_user(ossp->ss_size, &uw7_oss->ss_size);
14873 + __put_user(ossp->ss_flags, &uw7_oss->ss_flags);
14879 +getcontext(uw7_context_t * uc, struct pt_regs * regs)
14881 + uw7_context_t tmp = { 0 };
14883 + return copy_to_user(uc, &tmp, sizeof(uw7_context_t)) ? -EFAULT : 0;
14887 +getxcontext(uw7_context_t * uc, struct pt_regs * regs)
14893 +setcontext(uw7_context_t * uc, struct pt_regs * regs)
14895 + if (!uc) /* SVR4 says setcontext(NULL) => exit(0) */
14901 +uw7_context(struct pt_regs * regs)
14903 + int fcn = get_syscall_parameter(regs, 0);
14904 + uw7_context_t * uc = (uw7_context_t *) get_syscall_parameter(regs, 1);
14907 + case UW7_GETCONTEXT:
14908 + return getcontext(uc, regs);
14910 + case UW7_GETXCONTEXT:
14911 + return getxcontext(uc, regs);
14913 + case UW7_SETCONTEXT:
14914 + return setcontext(uc, regs);
14918 diff -Nru linux-2.6.7/abi/uw7/ioctl.c linux-2.6.7-abi/abi/uw7/ioctl.c
14919 --- linux-2.6.7/abi/uw7/ioctl.c 1970-01-01 01:00:00.000000000 +0100
14920 +++ linux-2.6.7-abi/abi/uw7/ioctl.c 2004-07-22 17:44:21.000000000 +0200
14923 + * abi/uw7/ioctl.c - Support for UnixWare 7.x ioctl(2) system call.
14925 + * This module provides a function uw7_ioctl() which is called indirectly
14926 + * via uw7_funcs[] array, see abi/uw7/funcs.c.
14927 + * This software is under GPL
14930 +#include <linux/errno.h>
14931 +#include <linux/sched.h>
14932 +#include <linux/syscalls.h>
14933 +#include <linux/termios.h>
14934 +#include <asm/uaccess.h>
14936 +#include <asm/abi_machdep.h>
14938 +#include <abi/uw7/termbits.h>
14939 +#include <abi/uw7/termios.h>
14940 +#include <abi/svr4/ioctl.h>
14946 +#define DBG(x...) printk(x)
14952 +static int tioc_tcgets(int fd, struct uw7_termios * tios);
14953 +static int tioc_tcsets(int fd, int lnx_cmd, struct uw7_termios * tios);
14954 +static int ioctl_T(int fd, unsigned int cmd, void * arg);
14957 +int uw7_ioctl(struct pt_regs * regs)
14960 + unsigned int cmd, class;
14963 + fd = (int)get_syscall_parameter(regs, 0);
14964 + cmd = (unsigned int)get_syscall_parameter(regs, 1);
14965 + arg = (void *)get_syscall_parameter(regs, 2);
14966 + class = cmd >> 8;
14970 + return ioctl_T(fd, cmd, arg);
14972 + return __svr4_ioctl(regs, fd, cmd, arg);
14976 +static int tioc_tcsets(int fd, int lnx_cmd, struct uw7_termios * tios)
14978 + struct termios t;
14979 + struct uw7_termios tmp = {0, };
14980 + mm_segment_t old_fs;
14983 + DBG(KERN_ERR "UW7[%d]: tioc_tcsets(%d,%x,%p)\n",
14984 + current->pid, fd, lnx_cmd, tios);
14986 + error = verify_area(VERIFY_READ, tios, sizeof(struct uw7_termios));
14990 + old_fs = get_fs();
14991 + set_fs(get_ds());
14992 + error = sys_ioctl(fd, TCGETS, (long)&t);
14997 + if (copy_from_user(&tmp, tios, sizeof(struct uw7_termios)))
14999 + t.c_iflag = tmp.c_iflag & ~UW7_DOSMODE;
15000 + t.c_oflag = tmp.c_oflag;
15001 + t.c_cflag = tmp.c_cflag;
15002 + t.c_lflag = tmp.c_lflag & ~UW7_DEFECHO;
15003 + if (tmp.c_lflag & UW7_FLUSHO)
15004 + t.c_lflag |= FLUSHO;
15006 + t.c_lflag &= ~FLUSHO;
15009 + "UW7[%d]: iflag: %lx->%lx, oflag: %lx->%lx, cflag: %lx->%lx, lflag: %lx->%lx\n",
15010 + current->pid, tmp.c_iflag, t.c_iflag, tmp.c_oflag, t.c_oflag,
15011 + tmp.c_cflag, t.c_cflag, tmp.c_lflag, t.c_lflag);
15013 + t.c_cc[VINTR] = tmp.c_cc[UW7_VINTR];
15014 + t.c_cc[VQUIT] = tmp.c_cc[UW7_VQUIT];
15015 + t.c_cc[VERASE] = tmp.c_cc[UW7_VERASE];
15016 + t.c_cc[VKILL] = tmp.c_cc[UW7_VKILL];
15017 + t.c_cc[VEOL2] = tmp.c_cc[UW7_VEOL2];
15018 + t.c_cc[VSWTC] = tmp.c_cc[UW7_VSWTCH];
15019 + t.c_cc[VSTART] = tmp.c_cc[UW7_VSTART];
15020 + t.c_cc[VSTOP] = tmp.c_cc[UW7_VSTOP];
15021 + t.c_cc[VSUSP] = tmp.c_cc[UW7_VSUSP];
15022 + t.c_cc[VREPRINT] = tmp.c_cc[UW7_VREPRINT];
15023 + t.c_cc[VDISCARD] = tmp.c_cc[UW7_VDISCARD];
15024 + t.c_cc[VWERASE] = tmp.c_cc[UW7_VWERASE];
15025 + t.c_cc[VLNEXT] = tmp.c_cc[UW7_VLNEXT];
15026 + if (t.c_lflag & ICANON) {
15027 + t.c_cc[VEOF] = tmp.c_cc[UW7_VEOF];
15028 + t.c_cc[VEOL] = tmp.c_cc[UW7_VEOL];
15030 + t.c_cc[VMIN] = tmp.c_cc[UW7_VMIN];
15031 + t.c_cc[VTIME] = tmp.c_cc[UW7_VTIME];
15032 + t.c_cc[VEOL] = tmp.c_cc[UW7_VEOL2];
15038 + "VINTR: %x->%x, VQUIT: %x->%x, VERASE: %x->%x, VKILL: %x->%x\n"
15039 + "VEOL2: %x->%x\n",
15040 + current->pid, tmp.c_cc[UW7_VINTR], t.c_cc[VINTR],
15041 + tmp.c_cc[UW7_VQUIT], t.c_cc[VQUIT],
15042 + tmp.c_cc[UW7_VERASE], t.c_cc[VERASE],
15043 + tmp.c_cc[UW7_VKILL], t.c_cc[VKILL],
15044 + tmp.c_cc[UW7_VEOL2], t.c_cc[VEOL2]);
15046 + old_fs = get_fs();
15047 + set_fs(get_ds());
15048 + error = sys_ioctl(fd, lnx_cmd, (long)&t);
15053 +static int tioc_tcgets(int fd, struct uw7_termios * tios)
15055 + struct termios t;
15056 + struct uw7_termios tmp = { 0 };
15057 + mm_segment_t old_fs;
15060 + DBG(KERN_ERR "UW7[%d]: tioc_tcgets(%d,%p)\n", current->pid, fd, tios);
15062 + old_fs = get_fs();
15063 + set_fs(get_ds());
15064 + error = sys_ioctl(fd, TCGETS, (long)&t);
15069 + tmp.c_iflag = UW7_IFLAG_MSK & (t.c_iflag & ~UW7_DOSMODE);
15070 + tmp.c_oflag = UW7_OFLAG_MSK & t.c_oflag;
15071 + tmp.c_cflag = UW7_CFLAG_MSK & t.c_cflag;
15072 + tmp.c_lflag = UW7_LFLAG_MSK & (t.c_lflag & ~UW7_DEFECHO);
15073 + if (t.c_lflag & FLUSHO)
15074 + tmp.c_lflag |= UW7_FLUSHO;
15076 + tmp.c_lflag &= ~UW7_FLUSHO;
15079 + "UW7[%d]: iflag: %lx->%lx, oflag: %lx->%lx, cflag: %lx->%lx, lflag: %lx->%lx\n",
15080 + current->pid, tmp.c_iflag, t.c_iflag, tmp.c_oflag, t.c_oflag,
15081 + tmp.c_cflag, t.c_cflag, tmp.c_lflag, t.c_lflag);
15083 + if (t.c_lflag & ICANON) {
15084 + tmp.c_cc[UW7_VEOF] = t.c_cc[VEOF];
15085 + tmp.c_cc[UW7_VEOL] = t.c_cc[VEOL];
15087 + tmp.c_cc[UW7_VMIN] = t.c_cc[VMIN];
15088 + tmp.c_cc[UW7_VTIME] = t.c_cc[VTIME];
15091 + tmp.c_cc[UW7_VINTR] = t.c_cc[VINTR];
15092 + tmp.c_cc[UW7_VQUIT] = t.c_cc[VQUIT];
15093 + tmp.c_cc[UW7_VERASE] = t.c_cc[VERASE];
15094 + tmp.c_cc[UW7_VKILL] = t.c_cc[VKILL];
15095 + tmp.c_cc[UW7_VEOL2] = t.c_cc[VEOL2];
15096 + tmp.c_cc[UW7_VSWTCH] = t.c_cc[VSWTC];
15097 + tmp.c_cc[UW7_VSTART] = t.c_cc[VSTART];
15098 + tmp.c_cc[UW7_VSTOP] = t.c_cc[VSTOP];
15099 + tmp.c_cc[UW7_VSUSP] = tmp.c_cc[UW7_VDSUSP] = t.c_cc[VSUSP];
15100 + tmp.c_cc[UW7_VREPRINT] = t.c_cc[VREPRINT];
15101 + tmp.c_cc[UW7_VDISCARD] = t.c_cc[VDISCARD];
15102 + tmp.c_cc[UW7_VWERASE] = t.c_cc[VWERASE];
15103 + tmp.c_cc[UW7_VLNEXT] = t.c_cc[VLNEXT];
15105 + return copy_to_user(tios, &tmp, sizeof(struct uw7_termios)) ? -EFAULT : 0;
15108 +static int ioctl_T(int fd, unsigned int cmd, void * arg)
15110 + DBG(KERN_ERR "ioctl_T(%d,%x,%p)\n", fd, cmd, arg);
15114 + return sys_ioctl(fd, TCSBRK, (long)arg);
15117 + return sys_ioctl(fd, TCXONC, (long)arg);
15120 + return sys_ioctl(fd, TCFLSH, (long)arg);
15122 + case UW7_TIOCSWINSZ:
15123 + return sys_ioctl(fd, TIOCSWINSZ, (long)arg);
15125 + case UW7_TIOCGWINSZ:
15126 + return sys_ioctl(fd, TIOCGWINSZ, (long)arg);
15129 + return tioc_tcgets(fd, arg);
15132 + return tioc_tcsets(fd, TCSETS, arg);
15134 + case UW7_TCSETSW:
15135 + return tioc_tcsets(fd, TCSETSW, arg);
15137 + case UW7_TCSETSF:
15138 + return tioc_tcsets(fd, TCSETSF, arg);
15142 diff -Nru linux-2.6.7/abi/uw7/lfs.c linux-2.6.7-abi/abi/uw7/lfs.c
15143 --- linux-2.6.7/abi/uw7/lfs.c 1970-01-01 01:00:00.000000000 +0100
15144 +++ linux-2.6.7-abi/abi/uw7/lfs.c 2004-07-22 17:44:21.000000000 +0200
15147 + * Copyright (c) 1999 Tigran Aivazian.
15148 + * Copyright (c) 2001 Christoph Hellwig.
15149 + * All rights reserved.
15151 + * This program is free software; you can redistribute it and/or modify
15152 + * it under the terms of the GNU General Public License as published by
15153 + * the Free Software Foundation; either version 2 of the License, or
15154 + * (at your option) any later version.
15156 + * This program is distributed in the hope that it will be useful,
15157 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
15158 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15159 + * GNU General Public License for more details.
15161 + * You should have received a copy of the GNU General Public License
15162 + * along with this program; if not, write to the Free Software
15163 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15169 + * Support for the UnixWare 7.x LFS (Large File Summit) syscalls.
15171 +#include <linux/sched.h>
15172 +#include <linux/file.h>
15173 +#include <linux/fs.h>
15174 +#include <linux/statfs.h>
15175 +#include <linux/kernel.h>
15176 +#include <linux/unistd.h>
15177 +#include <linux/syscalls.h>
15178 +#include <linux/namei.h>
15179 +#include <asm/uaccess.h>
15181 +#include <abi/uw7/resource.h>
15182 +#include <abi/uw7/statvfs.h>
15186 + * The UnixWare 7 truncate64/fruncate64 syscalls are the same as in
15187 + * Linux, but we can't easily handle long long syscall parameters for
15188 + * lcall7, thus we have to fake two 32bit arguments instead.
15190 + * XXX: if do_sys_truncate/do_sys_ftruncate in fs/open.c were exported
15191 + * we could get rid of one function call.
15194 +uw7_truncate64(const char *filename, u_int len, u_int len_hi)
15196 + return sys_truncate64(filename, (len | (loff_t)len_hi << 32));
15200 +uw7_ftruncate64(int fd, u_int len, u_int len_hi)
15202 + return sys_ftruncate64(fd, (len | (loff_t)len_hi << 32));
15206 + * The SVR4 statvfs is basically our statfs, but of course only
15210 +cp_uw7_statvfs64(struct super_block *sbp, struct kstatfs *srcp,
15211 + struct uw7_statvfs64 *dstp)
15213 + struct uw7_statvfs64 tmp;
15215 + memset(&tmp, 0, sizeof(struct uw7_statvfs64));
15217 + tmp.f_bsize = srcp->f_bsize;
15218 + tmp.f_frsize = srcp->f_bsize;
15219 + tmp.f_blocks = srcp->f_blocks;
15220 + tmp.f_bfree = srcp->f_bfree;
15221 + tmp.f_bavail = srcp->f_bavail;
15222 + tmp.f_files = srcp->f_files;
15223 + tmp.f_ffree = srcp->f_ffree;
15224 + tmp.f_favail = srcp->f_ffree;
15225 + tmp.f_fsid = sbp->s_dev;
15227 + strcpy(tmp.f_basetype, sbp->s_type->name);
15229 + tmp.f_namemax = srcp->f_namelen;
15231 + if (copy_to_user(dstp, &tmp, sizeof(struct uw7_statvfs64)))
15237 +uw7_statvfs64(char *filename, struct uw7_statvfs64 *stvfsp)
15239 + struct nameidata nd;
15242 + error = user_path_walk(filename, &nd);
15244 + struct super_block *sbp = nd.dentry->d_inode->i_sb;
15245 + struct kstatfs tmp;
15247 + error = vfs_statfs(sbp, &tmp);
15248 + if (!error && cp_uw7_statvfs64(sbp, &tmp, stvfsp))
15250 + path_release(&nd);
15258 +uw7_fstatvfs64(int fd, struct uw7_statvfs64 *stvfsp)
15261 + int error = -EBADF;
15265 + struct super_block *sbp = fp->f_dentry->d_inode->i_sb;
15266 + struct kstatfs tmp;
15268 + error = vfs_statfs(sbp, &tmp);
15269 + if (!error && cp_uw7_statvfs64(sbp, &tmp, stvfsp))
15277 +static __inline__ int
15278 +uw7_rlim64_to_user(int resource, struct uw7_rlim64 *rlimp)
15280 + struct rlimit *lxrlim = current->rlim + resource;
15281 + struct uw7_rlim64 rlim;
15283 + rlim.rlim_cur = lxrlim->rlim_cur;
15284 + rlim.rlim_max = lxrlim->rlim_max;
15286 + if (copy_to_user(rlimp, &rlim, sizeof(struct uw7_rlim64)))
15292 +uw7_getrlimit64(int resource, struct uw7_rlim64 *rlimp)
15294 + if (resource > ARRAY_SIZE(uw7_to_linux_rlimit))
15297 + return (uw7_rlim64_to_user(uw7_to_linux_rlimit[resource], rlimp));
15300 +static __inline__ int
15301 +uw7_check_rlimit64(int resource, const struct uw7_rlim64 *rlimp,
15302 + struct rlimit *lxrlimp)
15304 + if ((rlimp->rlim_cur > RLIM_INFINITY) ||
15305 + (rlimp->rlim_max > RLIM_INFINITY))
15306 + return -EPERM; /* XXX: actually this is wrong */
15308 + if (((rlimp->rlim_cur > lxrlimp->rlim_max) ||
15309 + (rlimp->rlim_max > lxrlimp->rlim_max)) &&
15310 + !capable(CAP_SYS_RESOURCE))
15313 + if (resource == RLIMIT_NOFILE &&
15314 + (rlimp->rlim_cur > NR_OPEN || rlimp->rlim_max > NR_OPEN))
15321 +uw7_setrlimit64(int resource, const struct uw7_rlim64 *rlimp)
15323 + struct rlimit *lxrlim = current->rlim + resource;
15324 + struct uw7_rlim64 rlim;
15326 + if (resource > ARRAY_SIZE(uw7_to_linux_rlimit))
15328 + if (copy_from_user(&rlim, rlimp, sizeof(struct uw7_rlim64)))
15330 + if (uw7_check_rlimit64(resource, &rlim, lxrlim))
15333 + /* XXX: this is non-atomic. */
15334 + lxrlim->rlim_cur = rlim.rlim_cur;
15335 + lxrlim->rlim_max = rlim.rlim_max;
15341 + * 64bit lseek for UnixWare.
15344 +uw7_lseek64(int fd, u_int off, u_int off_hi, int orig)
15349 + if (off_hi == (u_int)-1)
15352 + err = sys_llseek(fd, (off_t) off_hi, off, &result, orig);
15355 + return (long)result; /* XXX: how does UnixWare return large results? */
15359 + * The UnixWare 7 pread64/pwrite64 syscalls are the same as in Linux,
15360 + * but we can't easily handle long long syscall parameters for lcall7,
15361 + * thus we have to fake two 32bit arguments instead.
15364 +uw7_pread64(int fd, char *bufp, int count, u_int pos, u_int pos_hi)
15366 + return sys_pread64(fd, bufp, count, (pos | (loff_t)pos_hi << 32));
15370 +uw7_pwrite64(int fd, char *bufp, int count, u_int pos, u_int pos_hi)
15372 + return sys_pwrite64(fd, bufp, count, (pos | (loff_t)pos_hi << 32));
15376 + * Unlike Linux UnixWare 7 does not simply add O_LARGEFILE to flags in
15377 + * libc, so we have to do it.
15378 + * We call sys_open directly as sys_creat is just yet another wrapper.
15380 +#define UW7_CREAT64_FLAGS \
15381 + (O_LARGEFILE | O_CREAT | O_WRONLY | O_TRUNC)
15383 +uw7_creat64(const char *filename, int mode)
15385 + return sys_open(filename, UW7_CREAT64_FLAGS, mode);
15387 diff -Nru linux-2.6.7/abi/uw7/mac.c linux-2.6.7-abi/abi/uw7/mac.c
15388 --- linux-2.6.7/abi/uw7/mac.c 1970-01-01 01:00:00.000000000 +0100
15389 +++ linux-2.6.7-abi/abi/uw7/mac.c 2004-07-22 17:44:21.000000000 +0200
15392 + * abi/uw7/mac.c - mldmode(2) and friends.
15394 + * This software is under GPL
15397 +#include <linux/sched.h>
15398 +#include <linux/errno.h>
15403 +#define DBG(x...) printk(x)
15408 +#define UW7_MLD_REAL 1
15409 +#define UW7_MLD_VIRT 0
15410 +#define UW7_MLD_QUERY 2
15412 +int uw7_mldmode(int mldmode)
15414 + switch (mldmode) {
15415 + case UW7_MLD_REAL:
15416 + DBG(KERN_ERR "UW7[%d]: mldmode(MLD_REAL)\n", current->pid);
15419 + case UW7_MLD_VIRT:
15420 + DBG(KERN_ERR "UW7[%d]: mldmode(MLD_VIRT)\n", current->pid);
15423 + case UW7_MLD_QUERY:
15424 + DBG(KERN_ERR "UW7[%d]: mldmode(MLD_QUERY)\n", current->pid);
15425 + return UW7_MLD_REAL;
15432 diff -Nru linux-2.6.7/abi/uw7/Makefile linux-2.6.7-abi/abi/uw7/Makefile
15433 --- linux-2.6.7/abi/uw7/Makefile 1970-01-01 01:00:00.000000000 +0100
15434 +++ linux-2.6.7-abi/abi/uw7/Makefile 2004-07-22 17:44:21.000000000 +0200
15437 +abi-uw7-objs := access.o context.o ioctl.o lfs.o mac.o \
15438 + misc.o mmap.o stat.o sysent.o
15440 +obj-$(CONFIG_ABI_UW7) += abi-uw7.o
15442 +abi-uw7.o: $(abi-uw7-objs)
15443 + $(LD) -r -o $@ $(abi-uw7-objs)
15444 diff -Nru linux-2.6.7/abi/uw7/misc.c linux-2.6.7-abi/abi/uw7/misc.c
15445 --- linux-2.6.7/abi/uw7/misc.c 1970-01-01 01:00:00.000000000 +0100
15446 +++ linux-2.6.7-abi/abi/uw7/misc.c 2004-07-22 17:44:21.000000000 +0200
15449 + * abi/uw7/misc.c - various UW7 system calls.
15451 + * This software is under GPL
15454 +#include <linux/errno.h>
15455 +#include <linux/kernel.h>
15456 +#include <linux/sched.h>
15457 +#include <linux/file.h>
15458 +#include <linux/syscalls.h>
15459 +#include <asm/uaccess.h>
15462 +int uw7_sleep(int seconds)
15464 + struct timespec t;
15465 + mm_segment_t old_fs;
15468 + t.tv_sec = seconds;
15470 + old_fs = get_fs();
15471 + set_fs(get_ds());
15472 + error = sys_nanosleep(&t, NULL);
15477 +#define UW7_MAXUID 60002
15479 +int uw7_seteuid(int uid)
15481 + if (uid < 0 || uid > UW7_MAXUID)
15483 + return sys_setreuid16(-1, uid);
15486 +int uw7_setegid(int gid)
15488 + if (gid < 0 || gid > UW7_MAXUID)
15490 + return sys_setreuid16(-1, gid);
15493 +/* can't call sys_pread64() directly because off is 32bit on UW7 */
15494 +int uw7_pread(unsigned int fd, char * buf, int count, long off)
15496 + return sys_pread64(fd, buf, count, (loff_t)off);
15499 +/* can't call sys_pwrite64() directly because off is 32bit on UW7 */
15500 +int uw7_pwrite(unsigned int fd, char * buf, int count, long off)
15502 + return sys_pwrite64(fd, buf, count, (loff_t)off);
15505 +int uw7_stty(int fd, int cmd)
15510 +int uw7_gtty(int fd, int cmd)
15514 diff -Nru linux-2.6.7/abi/uw7/mmap.c linux-2.6.7-abi/abi/uw7/mmap.c
15515 --- linux-2.6.7/abi/uw7/mmap.c 1970-01-01 01:00:00.000000000 +0100
15516 +++ linux-2.6.7-abi/abi/uw7/mmap.c 2004-07-22 17:44:21.000000000 +0200
15519 + * Copyright (c) 1999 Tigran Aivazian.
15520 + * Copyright (c) 2001 Christoph Hellwig.
15521 + * All rights reserved.
15523 + * This program is free software; you can redistribute it and/or modify
15524 + * it under the terms of the GNU General Public License as published by
15525 + * the Free Software Foundation; either version 2 of the License, or
15526 + * (at your option) any later version.
15528 + * This program is distributed in the hope that it will be useful,
15529 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
15530 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15531 + * GNU General Public License for more details.
15533 + * You should have received a copy of the GNU General Public License
15534 + * along with this program; if not, write to the Free Software
15535 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15541 + * Support for mmap on UnixWare 7.
15543 +#include <linux/mm.h>
15544 +#include <linux/errno.h>
15545 +#include <linux/file.h>
15546 +#include <linux/mman.h>
15548 +#include <asm/uaccess.h>
15551 +/* the other MAP_XXX values are the same as on Linux/i386 */
15552 +#define UW7_MAP_ANONYMOUS 0x100
15555 +uw7_mmap64(u_long addr, size_t len, int prot, int flags,
15556 + int fd, u_int off, u_int off_hi)
15558 + loff_t off64 = (off | ((loff_t)off_hi << 32));
15559 + u_long pgoff = (off64 >> PAGE_SHIFT);
15560 + int error = -EBADF;
15561 + struct file *fp = NULL;
15563 + if ((off64 + PAGE_ALIGN(len)) < off64)
15566 + if (!(off64 & ~PAGE_MASK))
15569 + if (flags & UW7_MAP_ANONYMOUS) {
15570 + flags |= MAP_ANONYMOUS;
15571 + flags &= ~UW7_MAP_ANONYMOUS;
15574 + flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
15575 + if (!(flags & MAP_ANONYMOUS)) {
15576 + if (!(fp = fget(fd)))
15580 + down_write(¤t->mm->mmap_sem);
15581 + error = do_mmap_pgoff(fp, addr, len, prot, flags, pgoff);
15582 + up_write(¤t->mm->mmap_sem);
15589 diff -Nru linux-2.6.7/abi/uw7/stat.c linux-2.6.7-abi/abi/uw7/stat.c
15590 --- linux-2.6.7/abi/uw7/stat.c 1970-01-01 01:00:00.000000000 +0100
15591 +++ linux-2.6.7-abi/abi/uw7/stat.c 2004-07-22 17:44:21.000000000 +0200
15594 + * Copyright (c) 2001 Christoph Hellwig.
15595 + * All rights reserved.
15597 + * This program is free software; you can redistribute it and/or modify
15598 + * it under the terms of the GNU General Public License as published by
15599 + * the Free Software Foundation; either version 2 of the License, or
15600 + * (at your option) any later version.
15602 + * This program is distributed in the hope that it will be useful,
15603 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
15604 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15605 + * GNU General Public License for more details.
15607 + * You should have received a copy of the GNU General Public License
15608 + * aint32_t with this program; if not, write to the Free Software
15609 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15615 + * UnixWare 7.x xstat support.
15617 +#include <linux/kernel.h>
15618 +#include <linux/fs.h>
15619 +#include <linux/sched.h>
15620 +#include <linux/file.h>
15621 +#include <linux/string.h>
15622 +#include <asm/uaccess.h>
15624 +#include <abi/uw7/types.h>
15625 +#include <abi/uw7/stat.h>
15626 +#include <abi/svr4/stat.h>
15628 +#include <abi/util/trace.h>
15629 +#include <abi/util/stat.h>
15632 +enum {SVR4_stat = 1, SVR4_xstat = 2, UW7_stat64 = 4};
15635 +report_uw7_stat64(struct kstat *stp, struct uw7_stat64 *bufp)
15637 + struct uw7_stat64 buf;
15639 + memset(&buf, 0, sizeof(struct uw7_stat64));
15641 + buf.st_dev = linux_to_uw7_dev_t(stp->dev);
15642 + buf.st_ino = linux_to_uw7_ino_t(stp->ino);
15643 + buf.st_mode = stp->mode;
15644 + buf.st_nlink = stp->nlink;
15645 + buf.st_uid = linux_to_uw7_uid_t(stp->uid);
15646 + buf.st_gid = linux_to_uw7_gid_t(stp->gid);
15647 + buf.st_rdev = linux_to_uw7_dev_t(stp->rdev);
15648 + buf.st_size = stp->size;
15650 + buf.st_atime.tv_sec = stp->atime.tv_sec;
15651 + buf.st_mtime.tv_sec = stp->mtime.tv_sec;
15652 + buf.st_ctime.tv_sec = stp->ctime.tv_sec;
15654 + buf.st_blksize = stp->blksize;
15655 + buf.st_blocks = stp->blocks;
15657 + strcpy(buf.st_fstype, "ext2");
15659 + if (copy_to_user(bufp, &buf, sizeof(struct uw7_stat64)))
15665 +uw7_xstat(int vers, char *filename, void *bufp)
15670 + error = vfs_stat(filename, &st);
15676 + return report_svr4_stat(&st, bufp);
15678 + return report_svr4_xstat(&st, bufp);
15680 + return report_uw7_stat64(&st, bufp);
15683 +#if defined(CONFIG_ABI_TRACE)
15684 + abi_trace(ABI_TRACE_API, "xstat version %d not supported\n", vers);
15690 +uw7_lxstat(int vers, char *filename, void *bufp)
15695 + error = vfs_lstat(filename, &st);
15701 + return report_svr4_stat(&st, bufp);
15703 + return report_svr4_xstat(&st, bufp);
15705 + return report_uw7_stat64(&st, bufp);
15708 +#if defined(CONFIG_ABI_TRACE)
15709 + abi_trace(ABI_TRACE_API, "lxstat version %d not supported\n", vers);
15715 +uw7_fxstat(int vers, int fd, void *bufp)
15720 + error = vfs_fstat(fd, &st);
15726 + return report_svr4_stat(&st, bufp);
15728 + return report_svr4_xstat(&st, bufp);
15730 + return report_uw7_stat64(&st, bufp);
15733 +#if defined(CONFIG_ABI_TRACE)
15734 + abi_trace(ABI_TRACE_API, "fxstat version %d not supported\n", vers);
15738 diff -Nru linux-2.6.7/abi/uw7/sysent.c linux-2.6.7-abi/abi/uw7/sysent.c
15739 --- linux-2.6.7/abi/uw7/sysent.c 1970-01-01 01:00:00.000000000 +0100
15740 +++ linux-2.6.7-abi/abi/uw7/sysent.c 2004-07-22 17:44:21.000000000 +0200
15743 + * Copyright (c) 1999 Tigran Aivazian.
15744 + * Copyright (c) 2000, 2001 Christoph Hellwig.
15745 + * All rights reserved.
15747 + * This program is free software; you can redistribute it and/or modify
15748 + * it under the terms of the GNU General Public License as published by
15749 + * the Free Software Foundation; either version 2 of the License, or
15750 + * (at your option) any later version.
15752 + * This program is distributed in the hope that it will be useful,
15753 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
15754 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15755 + * GNU General Public License for more details.
15757 + * You should have received a copy of the GNU General Public License
15758 + * along with this program; if not, write to the Free Software
15759 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15765 + * UnixWare 7/OpenUnix 8 personality switch.
15768 +#include <linux/config.h>
15769 +#include <linux/module.h>
15770 +#include <linux/init.h>
15771 +#include <linux/kernel.h>
15772 +#include <linux/personality.h>
15773 +#include <linux/syscalls.h>
15774 +#include <linux/socket.h>
15775 +#include <linux/net.h>
15776 +#include <asm/uaccess.h>
15778 +#include <abi/signal.h>
15780 +#include <abi/svr4/sysent.h>
15781 +#include <abi/uw7/sysent.h>
15783 +#include <abi/util/errno.h>
15784 +#include <abi/util/sysent.h>
15785 +#include <abi/util/socket.h>
15787 +MODULE_DESCRIPTION("UnixWare7/OpenUnix8 personality");
15788 +MODULE_AUTHOR("Tigran Aivazian, Christoph Hellwig");
15789 +MODULE_LICENSE("GPL");
15793 + * We could remove some of the long identity mapped runs but at the
15794 + * expense of extra comparisons for each mapping at run time...
15796 +static u_char uw7_err_table[] = {
15797 +/* 0 - 9 */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
15798 +/* 10 - 19 */ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
15799 +/* 20 - 29 */ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
15800 +/* 30 - 39 */ 30, 31, 32, 33, 34, 45, 78, 46, 89, 93,
15801 +/* 40 - 49 */ 90, 90, 35, 36, 37, 38, 39, 40, 41, 42,
15802 +/* 50 - 59 */ 43, 44, 50, 51, 52, 53, 54, 55, 56, 57,
15803 +/* 60 - 69 */ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
15804 +/* 70 - 79 */ 70, 71, 74, 76, 77, 79, 80, 81, 82, 83,
15805 +/* 80 - 89 */ 84, 85, 86, 87, 88, 91, 92, 94, 95, 96,
15806 +/* 90 - 99 */ 97, 98, 99, 120, 121, 122, 123, 124, 125, 126,
15807 +/* 100 - 109 */ 127, 128, 129, 130, 131, 132, 133, 134, 143, 144,
15808 +/* 110 - 119 */ 145, 146, 147, 148, 149, 150, 22, 135, 137, 138,
15809 +/* 120 - 122 */ 139, 140, 28
15813 + * Map Linux RESTART* values (512,513,514) to EINTR
15815 +static u_char lnx_err_table[] = {
15816 +/* 512 - 514 */ EINTR, EINTR, EINTR
15819 +struct map_segment uw7_err_map[] = {
15820 + { 0, 0+sizeof(uw7_err_table)-1, uw7_err_table },
15821 + { 512, 512+sizeof(lnx_err_table)-1, lnx_err_table },
15825 +static long linux_to_uw7_signals[NSIGNALS+1] = {
15826 +/* 0 - 3 */ 0, IBCS_SIGHUP, IBCS_SIGINT, IBCS_SIGQUIT,
15827 +/* 4 - 7 */ IBCS_SIGILL, IBCS_SIGTRAP, IBCS_SIGABRT, -1,
15828 +/* 8 - 11 */ IBCS_SIGFPE, IBCS_SIGKILL, IBCS_SIGUSR1, IBCS_SIGSEGV,
15829 +/* 12 - 15 */ IBCS_SIGUSR2, IBCS_SIGPIPE, IBCS_SIGALRM, IBCS_SIGTERM,
15830 +/* 16 - 19 */ IBCS_SIGSEGV, IBCS_SIGCHLD, IBCS_SIGCONT, IBCS_SIGSTOP,
15831 +/* 20 - 23 */ IBCS_SIGTSTP, IBCS_SIGTTIN, IBCS_SIGTTOU, IBCS_SIGURG,
15832 +/* 24 - 27 */ IBCS_SIGGXCPU, IBCS_SIGGXFSZ, IBCS_SIGVTALRM, IBCS_SIGPROF,
15833 +/* 28 - 31 */ IBCS_SIGWINCH, IBCS_SIGIO, IBCS_SIGPWR, -1,
15837 +static long uw7_to_linux_signals[NSIGNALS+1] = {
15838 +/* 0 - 3 */ 0, SIGHUP, SIGINT, SIGQUIT,
15839 +/* 4 - 7 */ SIGILL, SIGTRAP, SIGIOT, SIGUNUSED,
15840 +/* 8 - 11 */ SIGFPE, SIGKILL, SIGUNUSED, SIGSEGV,
15841 +/* 12 - 15 */ SIGUNUSED, SIGPIPE, SIGALRM, SIGTERM,
15842 +/* 16 - 19 */ SIGUSR1, SIGUSR2, SIGCHLD, SIGPWR,
15843 +/* 20 - 23 */ SIGWINCH, SIGURG, SIGPOLL, SIGSTOP,
15844 +/* 24 - 27 */ SIGTSTP, SIGCONT, SIGTTIN, SIGTTOU,
15845 +/* 28 - 31 */ SIGVTALRM, SIGPROF, SIGXCPU, SIGXFSZ,
15849 +static char uw7_socktype[] = {
15858 +static struct map_segment uw7_socktype_map[] = {
15859 + { 1, 6, uw7_socktype },
15863 +static struct map_segment uw7_sockopt_map[] = {
15864 + { 0x0001, 0x0001, (char *)SO_DEBUG },
15865 + { 0x0002, 0x0002, (char *)__SO_ACCEPTCON },
15866 + { 0x0004, 0x0004, (char *)SO_REUSEADDR },
15867 + { 0x0008, 0x0008, (char *)SO_KEEPALIVE },
15868 + { 0x0010, 0x0010, (char *)SO_DONTROUTE },
15869 + { 0x0020, 0x0020, (char *)SO_BROADCAST },
15870 + { 0x0040, 0x0040, (char *)SO_USELOOPBACK },
15871 + { 0x0080, 0x0080, (char *)SO_LINGER },
15872 + { 0x0100, 0x0100, (char *)SO_OOBINLINE },
15873 + { 0x0200, 0x0200, (char *)SO_ORDREL },
15874 + { 0x0400, 0x0400, (char *)SO_IMASOCKET },
15875 + { 0x1001, 0x1001, (char *)SO_SNDBUF },
15876 + { 0x1002, 0x1002, (char *)SO_RCVBUF },
15877 + { 0x1003, 0x1003, (char *)SO_SNDLOWAT },
15878 + { 0x1004, 0x1004, (char *)SO_RCVLOWAT },
15879 + { 0x1005, 0x1005, (char *)SO_SNDTIMEO },
15880 + { 0x1006, 0x1006, (char *)SO_RCVTIMEO },
15881 + { 0x1007, 0x1007, (char *)SO_ERROR },
15882 + { 0x1008, 0x1008, (char *)SO_TYPE },
15883 + { 0x1009, 0x1009, (char *)SO_PROTOTYPE },
15887 +static struct map_segment uw7_af_map[] = {
15893 +static struct sysent uw7_syscall_table[] = {
15894 +/* 0 */ { abi_syscall, Fast, "syscall", "" },
15895 +/* 2 */ { sys_exit, 1, "exit", "d" },
15896 +/* 3 */ { abi_fork, Spl, "fork", "" },
15897 +/* 4 */ { abi_read, 3, "read", "dpd" },
15898 +/* 5 */ { sys_write, 3, "write", "dpd" },
15899 +/* 6 */ { svr4_open, 3, "open", "soo" },
15900 +/* 7 */ { sys_close, 1, "close", "d" },
15901 +/* 8 */ { abi_wait, Spl, "wait", "xxx" },
15902 +/* 9 */ { sys_creat, 2, "creat", "so" },
15903 +/* 10 */ { sys_link, 2, "link", "ss" },
15904 +/* 11 */ { sys_unlink, 1, "unlink", "s" },
15905 +/* 12 */ { abi_exec, Spl, "exec", "sxx" },
15906 +/* 13 */ { sys_chdir, 1, "chdir", "s" },
15907 +/* 14 */ { abi_time, 0, "time", "" },
15908 +/* 15 */ { svr4_mknod, 3, "mknod", "soo" },
15909 +/* 16 */ { sys_chmod, 2, "chmod", "so" },
15910 +/* 17 */ { sys_chown, 3, "chown", "sdd" },
15911 +/* 18 */ { abi_brk, 1, "brk/break", "x" },
15912 +/* 19 */ { svr4_stat, 2, "stat", "sp" },
15913 +/* 21 */ { sys_lseek, 3, "seek/lseek", "ddd" },
15914 +/* 20 */ { abi_getpid, Spl, "getpid", "" },
15915 +/* 21 */ { 0, Ukn, "mount", "" },
15916 +/* 22 */ { sys_umount, 1, "umount", "s" },
15917 +/* 23 */ { sys_setuid, 1, "setuid", "d" },
15918 +/* 24 */ { abi_getuid, Spl, "getuid", "" },
15919 +/* 25 */ { sys_stime, 1, "stime", "d" },
15920 +/* 26 */ { 0, 4, "ptrace", "" },
15921 +/* 27 */ { sys_alarm, 1, "alarm", "d" },
15922 +/* 28 */ { svr4_fstat, 2, "fstat", "dp" },
15923 +/* 21 */ { sys_pause, 0, "pause", "" },
15924 +/* 30 */ { sys_utime, 2, "utime", "xx" },
15925 +/* 31 */ { uw7_stty, 2, "stty", "dd" },
15926 +/* 32 */ { uw7_gtty, 2, "gtty", "dd" },
15927 +/* 33 */ { uw7_access, 2, "access", "so" },
15928 +/* 34 */ { sys_nice, 1, "nice", "d" },
15929 +/* 35 */ { svr4_statfs, 4, "statfs", "spdd" },
15930 +/* 36 */ { sys_sync, 0, "sync", "" },
15931 +/* 37 */ { abi_kill, 2, "kill", "dd" },
15932 +/* 38 */ { svr4_fstatfs, 4, "fstatfs", "dpdd" },
15933 +/* 39 */ { abi_procids, Spl, "procids", "d" },
15934 +/* 40 */ { 0, Ukn, "cxenix", "" },
15935 +/* 41 */ { sys_dup, 1, "dup", "d" },
15936 +/* 42 */ { abi_pipe, Spl, "pipe", "" },
15937 +/* 43 */ { sys_times, 1, "times", "p" },
15938 +/* 44 */ { 0, 4, "", "" },
15939 +/* 45 */ { 0, Ukn, "plock", "" },
15940 +/* 46 */ { sys_setgid, 1, "setgid", "d" },
15941 +/* 47 */ { abi_getgid, Spl, "getgid", "" },
15942 +/* 48 */ { abi_sigfunc, Fast, "sigfunc", "xxx" },
15943 +/* 49 */ { svr4_msgsys, Spl, "msgsys", "dxddd" },
15944 +/* 50 */ { svr4_sysi86, 3, "sysi86/sys3b", "d" },
15945 +/* 51 */ { sys_acct, 1, "acct/sysacct", "x" },
15946 +/* 52 */ { svr4_shmsys, Fast, "shmsys", "ddxo" },
15947 +/* 53 */ { svr4_semsys, Spl, "semsys", "dddx" },
15948 +/* 54 */ { uw7_ioctl, Spl, "ioctl", "dxx" },
15949 +/* 55 */ { 0, 3, "uadmin", "xxx" },
15950 +/* 56 */ { 0, Ukn, "unimpl/exch", "" },
15951 +/* 57 */ { v7_utsname, 1, "utsys", "x" },
15952 +/* 58 */ { sys_fsync, 1, "fsync", "d" },
15953 +/* 59 */ { abi_exec, Spl, "execv", "spp" },
15954 +/* 60 */ { sys_umask, 1, "umask", "o" },
15955 +/* 61 */ { sys_chroot, 1, "chroot", "s" },
15956 +/* 62 */ { svr4_fcntl, 3, "fcntl", "dxx" },
15957 +/* 63 */ { svr4_ulimit, 2, "ulimit", "xx" },
15960 + * 64-69 were reserved for the UNIX PC, and are now use for NUMA calls.
15962 +/* 64 */ { 0, Ukn, "cg_ids", "" },
15963 +/* 65 */ { 0, Ukn, "cg_processors","" },
15964 +/* 66 */ { 0, Ukn, "cg_info", "" },
15965 +/* 67 */ { 0, Ukn, "cg_bind", "" },
15966 +/* 68 */ { 0, Ukn, "cg_current", "" },
15967 +/* 69 */ { 0, Ukn, "cg_memloc", "" },
15968 +/* 70 */ { 0, Ukn, "unimpl/advfs", "" },
15969 +/* 71 */ { 0, Ukn, "unimpl/unadvfs","" },
15970 +/* 72 */ { 0, Ukn, "unimpl/rmount","" },
15971 +/* 73 */ { 0, Ukn, "unimpl/rumount","" },
15972 +/* 74 */ { 0, Ukn, "unimpl/rfstart","" },
15973 +/* 75 */ { 0, Ukn, "unimpl 75", "" },
15974 +/* 76 */ { 0, Ukn, "unimpl/rdebug","" },
15975 +/* 77 */ { 0, Ukn, "unimpl/rfstop","" },
15976 +/* 78 */ { 0, Ukn, "rfsys", "" },
15977 +/* 89 */ { sys_rmdir, 1, "rmdir", "s" },
15978 +/* 80 */ { sys_mkdir, 2, "mkdir", "so" },
15979 +/* 81 */ { svr4_getdents, 3, "getdents", "dxd" },
15980 +/* 82 */ { 0, Ukn, "unimpl/libattach","" },
15981 +/* 83 */ { 0, Ukn, "unimpl/libdetach","" },
15982 +/* 84 */ { svr4_sysfs, 3, "sysfs", "dxx" },
15983 +/* 85 */ { svr4_getmsg, Spl, "getmsg", "dxxx" },
15984 +/* 86 */ { svr4_putmsg, Spl, "putmsg", "dxxd" },
15985 +/* 87 */ { sys_poll, 3, "poll", "xdd" },
15986 +/* 88 */ { svr4_lstat, 2, "lstat", "sp" },
15987 +/* 89 */ { sys_symlink, 2, "symlink", "ss" },
15988 +/* 90 */ { sys_readlink, 3, "readlink", "spd" },
15989 +/* 91 */ { sys_setgroups, 2, "setgroups", "dp" },
15990 +/* 92 */ { sys_getgroups, 2, "getgroups", "dp" },
15991 +/* 93 */ { sys_fchmod, 2, "fchmod", "do" },
15992 +/* 94 */ { sys_fchown, 3, "fchown", "ddd" },
15993 +/* 95 */ { abi_sigprocmask, 3, "sigprocmask", "dxx" },
15994 +/* 96 */ { abi_sigsuspend, Spl, "sigsuspend", "x" },
15995 +/* 97 */ { uw7_sigaltstack, 2, "sigaltstack", "xx" },
15996 +/* 98 */ { abi_sigaction, 3, "sigaction", "dxx" },
15997 +/* 99 */ { svr4_sigpending, 2, "sigpending", "dp" },
15998 +/* 100 */ { uw7_context, Spl, "ucontext", "" },
15999 +/* 101 */ { 0, Ukn, "evsys", "" },
16000 +/* 102 */ { 0, Ukn, "evtrapret", "" },
16001 +/* 103 */ { svr4_statvfs, 2, "statvfs", "sp" },
16002 +/* 104 */ { svr4_fstatvfs, 2, "fstatvfs", "dp" },
16003 +/* 105 */ { 0, Ukn, "reserved 105", "" },
16004 +/* 106 */ { 0, Ukn, "nfssys", "" },
16005 +/* 107 */ { svr4_waitid, 4, "waitid", "ddxd" },
16006 +/* 108 */ { 0, 3, "sigsendsys", "ddd" },
16007 +/* 109 */ { svr4_hrtsys, Spl, "hrtsys", "xxx" },
16008 +/* 110 */ { 0, 3, "acancel", "dxd" },
16009 +/* 111 */ { 0, Ukn, "async", "" },
16010 +/* 112 */ { 0, Ukn, "priocntlsys", "" },
16011 +/* 113 */ { svr4_pathconf, 2, "pathconf", "sd" },
16012 +/* 114 */ { 0, 3, "mincore", "xdx" },
16013 +/* 115 */ { svr4_mmap, 6, "mmap", "xxxxdx"},
16014 +/* 116 */ { sys_mprotect, 3, "mprotect", "xdx" },
16015 +/* 117 */ { sys_munmap, 2, "munmap", "xd" },
16016 +/* 118 */ { svr4_fpathconf, 2, "fpathconf", "dd" },
16017 +/* 119 */ { abi_fork, Spl, "vfork", "" },
16018 +/* 120 */ { sys_fchdir, 1, "fchdir", "d" },
16019 +/* 121 */ { sys_readv, 3, "readv", "dxd" },
16020 +/* 122 */ { sys_writev, 3, "writev", "dxd" },
16021 +/* 123 */ { uw7_xstat, 3, "xstat", "dsx" },
16022 +/* 124 */ { uw7_lxstat, 3, "lxstat", "dsx" },
16023 +/* 125 */ { uw7_fxstat, 3, "fxstat", "ddx" },
16024 +/* 126 */ { svr4_xmknod, 4, "xmknod", "dsox" },
16025 +/* 127 */ { 0, Spl, "syslocal", "d" },
16026 +/* 128 */ { svr4_getrlimit, 2, "setrlimit", "dx" },
16027 +/* 129 */ { svr4_setrlimit, 2, "getrlimit", "dx" },
16028 +/* 130 */ { sys_lchown, 3, "lchown", "sdd" },
16029 +/* 131 */ { 0, Ukn, "memcntl", "" },
16030 +#if defined(CONFIG_ABI_XTI)
16031 +/* 132 */ { svr4_getpmsg, 5, "getpmsg", "dxxxx" },
16032 +/* 133 */ { svr4_putpmsg, 5, "putpmsg", "dxxdd" },
16034 +/* 132 */ { 0, 5, "getpmsg", "dxxxx" },
16035 +/* 133 */ { 0, 5, "putpmsg", "dxxdd" },
16037 +/* 134 */ { sys_rename, 2, "rename", "ss" },
16038 +/* 135 */ { abi_utsname, 1, "uname", "x" },
16039 +/* 136 */ { uw7_setegid, 1, "setegid", "d" },
16040 +/* 137 */ { svr4_sysconfig, 1, "sysconfig", "d" },
16041 +/* 138 */ { 0, Ukn, "adjtime", "" },
16042 +/* 139 */ { svr4_sysinfo, 3, "systeminfo", "dsd" },
16043 +/* 140 */ { socksys_syscall, 1, "socksys_syscall","x" },
16044 +/* 141 */ { uw7_seteuid, 1, "seteuid", "d" },
16045 +/* 142 */ { 0, Ukn, "unimpl 142", "" },
16046 +/* 143 */ { 0, Ukn, "keyctl", "" },
16047 +/* 144 */ { 0, 2, "secsys", "dx" },
16048 +/* 145 */ { 0, 4, "filepriv", "sdxd" },
16049 +/* 146 */ { 0, 3, "procpriv", "dxd" },
16050 +/* 147 */ { 0, 3, "devstat", "sdx" },
16051 +/* 148 */ { 0, 5, "aclipc", "ddddx" },
16052 +/* 149 */ { 0, 3, "fdevstat", "ddx" },
16053 +/* 150 */ { 0, 3, "flvlfile", "ddx" },
16054 +/* 151 */ { 0, 3, "lvlfile", "sdx" },
16055 +/* 152 */ { 0, Ukn, "sendv", "" },
16056 +/* 153 */ { 0, 2, "lvlequal", "xx" },
16057 +/* 154 */ { 0, 2, "lvlproc", "dx" },
16058 +/* 155 */ { 0, Ukn, "unimpl 155", "" },
16059 +/* 156 */ { 0, 4, "lvlipc", "dddx" },
16060 +/* 157 */ { 0, 4, "acl", "sddx" },
16061 +/* 158 */ { 0, Ukn, "auditevt", "" },
16062 +/* 159 */ { 0, Ukn, "auditctl", "" },
16063 +/* 160 */ { 0, Ukn, "auditdmp", "" },
16064 +/* 161 */ { 0, Ukn, "auditlog", "" },
16065 +/* 162 */ { 0, Ukn, "auditbuf", "" },
16066 +/* 163 */ { 0, 2, "lvldom", "xx" },
16067 +/* 164 */ { 0, Ukn, "lvlvfs", "" },
16068 +/* 165 */ { 0, 2, "mkmld", "so" },
16069 +/* 166 */ { uw7_mldmode, 1, "mldmode", "d" },
16070 +/* 167 */ { 0, 2, "secadvise", "xx" },
16071 +/* 168 */ { 0, Ukn, "online", "" },
16072 +/* 169 */ { sys_setitimer, 3, "setitimer", "dxx" },
16073 +/* 170 */ { sys_getitimer, 2, "getitimer", "dx" },
16074 +/* 171 */ { sys_gettimeofday, 2, "gettimeofday", "xx" },
16075 +/* 172 */ { sys_settimeofday, 2, "settimeofday", "xx" },
16076 +/* 173 */ { 0, Ukn, "lwpcreate", "" },
16077 +/* 174 */ { 0, Ukn, "lwpexit", "" },
16078 +/* 175 */ { 0, Ukn, "lwpwait", "" },
16079 +/* 176 */ { 0, Ukn, "lwpself", "" },
16080 +/* 177 */ { 0, Ukn, "lwpinfo", "" },
16081 +/* 178 */ { 0, Ukn, "lwpprivate", "" },
16082 +/* 179 */ { 0, Ukn, "processorbind","" },
16083 +/* 180 */ { 0, Ukn, "processorexbind","" },
16084 +/* 181 */ { 0, Ukn, "unimpl 181", "" },
16085 +/* 182 */ { 0, Ukn, "sendv64", "" },
16086 +/* 183 */ { 0, Ukn, "prepblock", "" },
16087 +/* 184 */ { 0, Ukn, "block", "" },
16088 +/* 185 */ { 0, Ukn, "rdblock", "" },
16089 +/* 186 */ { 0, Ukn, "unblock", "" },
16090 +/* 187 */ { 0, Ukn, "cancelblock", "" },
16091 +/* 188 */ { 0, Ukn, "unimpl 188", "" },
16092 +/* 189 */ { uw7_pread, 4, "pread", "dsdd" },
16093 +/* 190 */ { uw7_pwrite, 4, "pwrite", "dsdd" },
16094 +/* 191 */ { sys_truncate, 2, "truncate", "sd" },
16095 +/* 192 */ { sys_ftruncate, 2, "ftruncate", "dd" },
16096 +/* 193 */ { 0, Ukn, "lwpkill", "" },
16097 +/* 194 */ { 0, Ukn, "sigwait", "" },
16098 +/* 195 */ { abi_fork, Spl, "fork1", "" },
16099 +/* 196 */ { abi_fork, Spl, "forkall", "" },
16102 + * 197-202 are for loadable kernel module support.
16104 +/* 197 */ { 0, Ukn, "modload", "" },
16105 +/* 198 */ { 0, Ukn, "moduload", "" },
16106 +/* 199 */ { 0, Ukn, "modpath", "" },
16107 +/* 200 */ { 0, Ukn, "modstat", "" },
16108 +/* 201 */ { 0, Ukn, "modadm", "" },
16109 +/* 202 */ { 0, Ukn, "getksym", "" },
16111 +/* 203 */ { 0, Ukn, "lwpsuspend", "" },
16112 +/* 204 */ { 0, Ukn, "lwpcontinue", "" },
16113 +/* 205 */ { 0, Ukn, "priocntllst", "" },
16114 +/* 206 */ { uw7_sleep, 1, "sleep", "d" },
16117 + * 207-209 are for post/wait synchronisation.
16119 +/* 207 */ { 0, Ukn, "lwp_sema_wait","" },
16120 +/* 208 */ { 0, Ukn, "lwp_sema_post","" },
16121 +/* 209 */ { 0, Ukn, "lwp_sema_trywait","" },
16123 +/* 210 */ { 0, Ukn, "reserved 210", "" },
16124 +/* 211 */ { 0, Ukn, "unused 211", "" },
16125 +/* 212 */ { 0, Ukn, "unused 212", "" },
16126 +/* 213 */ { 0, Ukn, "unused 213", "" },
16127 +/* 214 */ { 0, Ukn, "unused 214", "" },
16128 +/* 215 */ { 0, Ukn, "unused 215", "" },
16131 + * 216-226 are for LFS (Large File Summit) support
16133 +/* 216 */ { uw7_fstatvfs64, 2, "fstatvfs64", "dp" },
16134 +/* 217 */ { uw7_statvfs64, 2, "statvfs64", "sp" },
16135 +/* 218 */ { uw7_ftruncate64, 3, "ftruncate64", "sdd" },
16136 +/* 219 */ { uw7_truncate64, 3, "truncate64", "ddd" },
16137 +/* 220 */ { uw7_getrlimit64, 2, "getrlimit64", "dp" },
16138 +/* 221 */ { uw7_setrlimit64, 2, "setrlimit64", "dp" },
16139 +/* 222 */ { uw7_lseek64, 4, "lseek64", "dddd" },
16140 +/* 223 */ { uw7_mmap64, 7, "mmap64", "xxxxdxx"},
16141 +/* 224 */ { uw7_pread64, 5, "pread64", "dsddd" },
16142 +/* 225 */ { uw7_pwrite64, 5, "pwrite64", "dsddd" },
16143 +/* 226 */ { uw7_creat64, 2, "creat64", "so" },
16145 +/* 227 */ { 0, Ukn, "dshmsys", "" },
16146 +/* 228 */ { 0, Ukn, "invlpg", "" },
16149 + * 229-234 are used for SSI clustering (Nonstop cluster)
16151 +/* 229 */ { 0, Ukn, "rfork1", "" },
16152 +/* 230 */ { 0, Ukn, "rforkall", "" },
16153 +/* 231 */ { 0, Ukn, "rexecve", "" },
16154 +/* 232 */ { 0, Ukn, "migrate", "" },
16155 +/* 233 */ { 0, Ukn, "kill3", "" },
16156 +/* 234 */ { 0, Ukn, "ssisys", "" },
16159 + * 235-248 are for kernel-based sockets (Yeah, SVR5 finally got sockets)
16161 +/* 235 */ { 0, Ukn, "xaccept", "" },
16162 +/* 236 */ { 0, Ukn, "xbind", "" },
16163 +/* 237 */ { 0, Ukn, "xbindresvport","" },
16164 +/* 238 */ { 0, Ukn, "xconnect", "" },
16165 +/* 239 */ { 0, Ukn, "xgetsockaddr", "" },
16166 +/* 240 */ { 0, Ukn, "xgetsockopt", "" },
16167 +/* 241 */ { 0, Ukn, "xlisten", "" },
16168 +/* 242 */ { 0, Ukn, "xrecvmsg", "" },
16169 +/* 243 */ { 0, Ukn, "xsendmsg", "" },
16170 +/* 244 */ { 0, Ukn, "xsetsockaddr", "" },
16171 +/* 245 */ { 0, Ukn, "xsetsockopt", "" },
16172 +/* 246 */ { 0, Ukn, "xshutdown", "" },
16173 +/* 247 */ { 0, Ukn, "xsocket", "" },
16174 +/* 248 */ { 0, Ukn, "xsocketpair", "" },
16176 +/* 249 */ { 0, Ukn, "unused 249", "" },
16177 +/* 250 */ { 0, Ukn, "unused 250", "" },
16182 +uw7_lcall7(int segment, struct pt_regs *regs)
16184 + int sysno = regs->eax & 0xff;
16186 + if (sysno >= ARRAY_SIZE(uw7_syscall_table))
16187 + set_error(regs, iABI_errors(-EINVAL));
16189 + lcall7_dispatch(regs, &uw7_syscall_table[sysno], 1);
16192 +static struct exec_domain uw7_exec_domain = {
16193 + name: "UnixWare 7",
16194 + handler: uw7_lcall7,
16195 + pers_low: 14 /* PER_UW7 */,
16196 + pers_high: 14 /* PER_UW7 */,
16197 + signal_map: uw7_to_linux_signals,
16198 + signal_invmap: linux_to_uw7_signals,
16199 + err_map: uw7_err_map,
16200 + socktype_map: uw7_socktype_map,
16201 + sockopt_map: uw7_sockopt_map,
16202 + af_map: uw7_af_map,
16203 + module: THIS_MODULE
16209 + return register_exec_domain(&uw7_exec_domain);
16212 +static void __exit
16215 + unregister_exec_domain(&uw7_exec_domain);
16218 +module_init(init_uw7);
16219 +module_exit(cleanup_uw7);
16220 diff -Nru linux-2.6.7/abi/wyse/Makefile linux-2.6.7-abi/abi/wyse/Makefile
16221 --- linux-2.6.7/abi/wyse/Makefile 1970-01-01 01:00:00.000000000 +0100
16222 +++ linux-2.6.7-abi/abi/wyse/Makefile 2004-07-22 17:44:21.000000000 +0200
16225 +abi-wyse-objs := sysent.o ptrace.o socket.o
16227 +obj-$(CONFIG_ABI_WYSE) += abi-wyse.o
16229 +abi-wyse.o: $(abi-wyse-objs)
16230 + $(LD) -r -o $@ $(abi-wyse-objs)
16231 diff -Nru linux-2.6.7/abi/wyse/ptrace.c linux-2.6.7-abi/abi/wyse/ptrace.c
16232 --- linux-2.6.7/abi/wyse/ptrace.c 1970-01-01 01:00:00.000000000 +0100
16233 +++ linux-2.6.7-abi/abi/wyse/ptrace.c 2004-07-22 17:44:21.000000000 +0200
16236 + * ptrace.c - Wyse V/386 ptrace(2) support.
16238 + * Copyright (c) 1995 Mike Jagdis (jaggy@purplet.demon.co.uk)
16244 + * This file is nearly identical to abi/sco/ptrace.c, please keep it in sync.
16246 +#include <linux/module.h>
16247 +#include <linux/errno.h>
16248 +#include <linux/sched.h>
16249 +#include <linux/ptrace.h>
16250 +#include <linux/kernel.h>
16251 +#include <linux/mm.h>
16252 +#include <linux/personality.h>
16253 +#include <linux/user.h>
16254 +#define __KERNEL_SYSCALLS__
16255 +#include <linux/unistd.h>
16257 +#include <asm/uaccess.h>
16259 +#include <abi/signal.h>
16260 +#include <abi/util/trace.h>
16264 +#define U(X) ((unsigned long)&((struct user *)0)->X)
16267 +static unsigned long wysev386_to_linux_reg[NREGS] = {
16268 + U(regs.es), U(regs.ds), U(regs.edi), U(regs.esi),
16269 + U(regs.ebp), U(regs.esp),
16270 + U(regs.ebx), U(regs.edx), U(regs.ecx), U(regs.eax),
16271 + U(signal /* Trap */),
16272 + U(reserved /* ERR */),
16273 + U(regs.eip), U(regs.cs),
16275 + U(regs.esp /* UESP */),
16277 + U(regs.fs), U(regs.gs)
16280 +static const char *regnam[] = {
16281 + "EBX", "ECX", "EDX", "ESI", "EDI", "EBP", "EAX",
16282 + "DS", "ES", "FS", "GS", "ORIG_EAX", "EIP", "CS",
16283 + "EFL", "UESP", "SS"
16288 +wyse_ptrace(int req, int pid, u_long addr, u_long data)
16293 + * Slight variations between iBCS and Linux codes.
16295 + if (req == PTRACE_ATTACH)
16297 + else if (req == PTRACE_DETACH)
16300 + if (req == 3 || req == 6) {
16301 + /* get offset of u_ar0 */
16302 + if (addr == 0x1292)
16305 + /* remap access to the registers. */
16306 + if ((addr & 0xff00) == 0x4000) { /* Registers */
16307 + addr = (addr & 0xff) >> 2;
16308 + if (addr > NREGS)
16310 + addr = wysev386_to_linux_reg[addr];
16316 + if (req == 7 && data > 0) {
16317 + if (data > NSIGNALS)
16319 + data = current_thread_info()->exec_domain->signal_map[data];
16322 + if (req == 1 || req == 2 || req == 3) {
16323 + mm_segment_t old_fs = get_fs();
16326 + set_fs(get_ds());
16327 + error = sys_ptrace(req, pid, addr, (long)&res);
16334 +#if defined(CONFIG_ABI_TRACE)
16335 + if (req == 3 || req == 6) {
16336 + abi_trace(ABI_TRACE_API, "%ld [%s] = 0x%08lx\n",
16337 + addr >> 2, (addr >> 2) < ARRAY_SIZE(regnam) ?
16338 + regnam[addr >> 2] : "???",
16339 + req == 3 ? res : data);
16343 + if (req == 1 || req == 2 || req == 3)
16346 + return sys_ptrace(req, pid, addr, data);
16348 diff -Nru linux-2.6.7/abi/wyse/socket.c linux-2.6.7-abi/abi/wyse/socket.c
16349 --- linux-2.6.7/abi/wyse/socket.c 1970-01-01 01:00:00.000000000 +0100
16350 +++ linux-2.6.7-abi/abi/wyse/socket.c 2004-07-22 17:44:21.000000000 +0200
16353 + * Copyright (c) 1994,1996 Mike Jagdis.
16354 + * Copyright (c) 2001 Christoph Hellwig.
16355 + * All rights reserved.
16357 + * This program is free software; you can redistribute it and/or modify
16358 + * it under the terms of the GNU General Public License as published by
16359 + * the Free Software Foundation; either version 2 of the License, or
16360 + * (at your option) any later version.
16362 + * This program is distributed in the hope that it will be useful,
16363 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
16364 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16365 + * GNU General Public License for more details.
16367 + * You should have received a copy of the GNU General Public License
16368 + * along with this program; if not, write to the Free Software
16369 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16376 + * BSD-style socket support for Wyse/V386.
16378 +#include <linux/net.h>
16379 +#include <linux/personality.h>
16380 +#include <linux/syscalls.h>
16381 +#include <linux/utsname.h>
16382 +#include <linux/signal.h>
16383 +#include <linux/wait.h>
16384 +#include <linux/socket.h>
16385 +#include <linux/net.h>
16386 +#include <asm/uaccess.h>
16388 +#include <abi/util/map.h>
16389 +#include <abi/util/socket.h>
16390 +#include <abi/wyse/sysent.h>
16393 +int wyse_gethostname(char *name, int len)
16398 + down_read(&uts_sem);
16399 + error = verify_area(VERIFY_WRITE, name, len);
16402 + for (p = system_utsname.nodename; *p && len; p++,len--) {
16403 + __put_user(*p, name);
16406 + __put_user('\0', name);
16408 + up_read(&uts_sem);
16412 +int wyse_getdomainname(char *name, int len)
16417 + down_read(&uts_sem);
16418 + error = verify_area(VERIFY_WRITE, name, len);
16421 + for (p = system_utsname.domainname; *p && len; p++,len--) {
16422 + __put_user(*p, name);
16425 + __put_user('\0', name);
16427 + up_read(&uts_sem);
16431 +int wyse_wait3(int *loc)
16436 + pid = sys_wait4(-1, loc, WNOHANG, 0);
16440 + get_user(res, (unsigned long *)loc);
16442 + if ((res & 0xff) == 0x7f) {
16443 + int sig = (res >> 8) & 0xff;
16445 + sig = current_thread_info()->exec_domain->signal_map[sig];
16446 + res = (res & (~0xff00)) | (sig << 8);
16447 + put_user(res, (unsigned long *)loc);
16448 + } else if (res && res == (res & 0xff)) {
16449 + res = current_thread_info()->exec_domain->signal_map[res & 0x7f];
16450 + put_user(res, (unsigned long *)loc);
16456 +int wyse_socket(int family, int type, int protocol)
16458 + family = map_value(current_thread_info()->exec_domain->af_map, family, 0);
16459 + type = map_value(current_thread_info()->exec_domain->socktype_map, family, 0);
16461 + return sys_socket(family, type, protocol);
16464 +int wyse_setsockopt(int fd, int level, int optname, char *optval, int optlen)
16467 + case 0: /* IPPROTO_IP aka SOL_IP */
16468 + if (--optname == 0)
16470 + if (optname > 4) {
16472 + if (optname <= 33)
16474 + if (optname < 32 || optname > 36)
16479 + level = SOL_SOCKET;
16480 + optname = map_value(current_thread_info()->exec_domain->sockopt_map, optname, 0);
16481 + switch (optname) {
16484 + * SO_LINGER takes a struct linger as the argument
16485 + * but some code uses an int and expects to get
16486 + * away without an error. Sigh...
16488 + if (optlen == sizeof(int))
16492 + * The following are not currently implemented under Linux
16493 + * so we must fake them in reasonable ways.
16494 + * (Only SO_PROTOTYPE is documented in SCO's man page).
16496 + case SO_PROTOTYPE:
16498 + case SO_SNDTIMEO:
16499 + case SO_RCVTIMEO:
16500 + return -ENOPROTOOPT;
16502 + case SO_USELOOPBACK:
16503 + case SO_SNDLOWAT:
16504 + case SO_RCVLOWAT:
16508 + * The following are not currenty implemented under Linux
16509 + * and probably aren't settable anyway.
16511 + case SO_IMASOCKET:
16512 + return -ENOPROTOOPT;
16518 + * XXX We assume everything else uses the same level and
16519 + * XXX option numbers. This is true for IPPROTO_TCP(/SOL_TCP)
16520 + * XXX and TCP_NDELAY but is known to be incorrect for other
16521 + * XXX potential options :-(.
16526 + return sys_setsockopt(fd, level, optname, optval, optlen);
16529 +int wyse_getsockopt(int fd, int level, int optname, char *optval, int *optlen)
16531 + unsigned int len;
16534 + if (get_user(len,optlen))
16540 + case 0: /* IPPROTO_IP aka SOL_IP */
16541 + if (--optname == 0)
16543 + if (optname > 4) {
16545 + if (optname <= 33)
16547 + if (optname < 32 || optname > 36)
16552 + level = SOL_SOCKET;
16553 + optname = map_value(current_thread_info()->exec_domain->sockopt_map, optname, 0);
16554 + switch (optname) {
16557 + * SO_LINGER takes a struct linger as the argument
16558 + * but some code uses an int and expects to get
16559 + * away without an error. Sigh...
16561 + if (len != sizeof(int))
16567 + * The following are not currently implemented under Linux
16568 + * so we must fake them in reasonable ways.
16569 + * (Only SO_PROTOTYPE is documented in SCO's man page).
16571 + case SO_PROTOTYPE:
16576 + case SO_SNDTIMEO:
16577 + case SO_RCVTIMEO:
16578 + return -ENOPROTOOPT;
16580 + case SO_USELOOPBACK:
16581 + case SO_SNDLOWAT:
16582 + case SO_RCVLOWAT:
16586 + * The following are not currenty implemented under Linux
16587 + * and probably aren't settable anyway.
16589 + case SO_IMASOCKET:
16596 + if (len > sizeof(int))
16597 + len = sizeof(int);
16598 + if (copy_to_user(optval, &val, len))
16600 + if (put_user(len, optlen))
16606 + * XXX We assume everything else uses the same level and
16607 + * XXX option numbers. This is true for IPPROTO_TCP(/SOL_TCP)
16608 + * XXX and TCP_NDELAY but is known to be incorrect for other
16609 + * XXX potential options :-(.
16615 + return sys_getsockopt(fd, level, optname, optval, optlen);
16618 +int wyse_recvfrom(int fd, void *buff, size_t size, unsigned flags,
16619 + struct sockaddr *addr, int *addr_len)
16623 + error = sys_recvfrom(fd, buff, size, flags, addr, addr_len);
16624 + if (error == -EAGAIN)
16625 + error = -EWOULDBLOCK;
16629 +int wyse_recv(int fd, void *buff, size_t size, unsigned flags)
16633 + error = sys_recvfrom(fd, buff, size, flags, NULL, NULL);
16634 + if (error == -EAGAIN)
16635 + error = -EWOULDBLOCK;
16639 +int wyse_sendto(int fd, void *buff, size_t len, unsigned flags,
16640 + struct sockaddr *addr, int addr_len)
16644 + error = sys_sendto(fd, buff, len, flags, addr, addr_len);
16645 + if (error == -EAGAIN)
16646 + error = -EWOULDBLOCK;
16650 +int wyse_send(int fd, void *buff, size_t len, unsigned flags)
16654 + error = sys_sendto(fd, buff, len, flags, NULL, 0);
16655 + if (error == -EAGAIN)
16656 + error = -EWOULDBLOCK;
16659 diff -Nru linux-2.6.7/abi/wyse/sysent.c linux-2.6.7-abi/abi/wyse/sysent.c
16660 --- linux-2.6.7/abi/wyse/sysent.c 1970-01-01 01:00:00.000000000 +0100
16661 +++ linux-2.6.7-abi/abi/wyse/sysent.c 2004-07-22 17:44:21.000000000 +0200
16664 + * Copyright (c) 2001 Christoph Hellwig.
16665 + * All rights reserved.
16667 + * This program is free software; you can redistribute it and/or modify
16668 + * it under the terms of the GNU General Public License as published by
16669 + * the Free Software Foundation; either version 2 of the License, or
16670 + * (at your option) any later version.
16672 + * This program is distributed in the hope that it will be useful,
16673 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
16674 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16675 + * GNU General Public License for more details.
16677 + * You should have received a copy of the GNU General Public License
16678 + * along with this program; if not, write to the Free Software
16679 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16686 + * Wyse/V386 personality switch.
16688 +#include <linux/module.h>
16689 +#include <linux/init.h>
16690 +#include <linux/kernel.h>
16691 +#include <linux/personality.h>
16692 +#include <linux/sched.h>
16693 +#include <linux/syscalls.h>
16694 +#include <linux/socket.h>
16695 +#include <linux/net.h>
16696 +#include <asm/uaccess.h>
16698 +#include <abi/svr4/sysent.h>
16699 +#include <abi/wyse/sysent.h>
16701 +#include <abi/signal.h>
16703 +#include <abi/util/errno.h>
16704 +#include <abi/util/sysent.h>
16705 +#include <abi/util/socket.h>
16708 +MODULE_DESCRIPTION("Wyse/V386 personality");
16709 +MODULE_AUTHOR("Christoph Hellwig, partially taken from iBCS");
16710 +MODULE_LICENSE("GPL");
16714 + * local functions
16716 +static void wyse_class_nfs(struct pt_regs *);
16717 +static void wyse_class_tcp(struct pt_regs *);
16721 + * local variables
16723 +static u_char wyse_err_table[] = {
16724 + /* 0 - 9 */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
16725 + /* 10 - 19 */ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
16726 + /* 20 - 29 */ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
16727 + /* 30 - 39 */ 30, 31, 32, 33, 34, 45, 78, 46, 228, 46,
16728 + /* 40 - 49 */ 22, 231, 227, 200, 37, 38, 39, 40, 41, 42,
16729 + /* 50 - 59 */ 43, 44, 50, 51, 52, 53, 54, 55, 56, 57,
16730 + /* 60 - 69 */ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
16731 + /* 70 - 79 */ 70, 71, 74, 76, 77, 22, 80, 81, 82, 83,
16732 + /* 80 - 89 */ 84, 85, 86, 87, 22, 4, 22, 233, 203, 204,
16733 + /* 90 - 99 */ 205, 206, 207, 208, 209, 210, 211, 212, 213, 214,
16734 + /* 100 - 109 */ 215, 216, 217, 218, 219, 220, 221, 222, 223, 224,
16735 + /* 110 - 119 */ 225, 226, 229, 230, 202, 201, 237, 135, 137, 138,
16736 + /* 120 - 122 */ 139, 140, 234
16740 + * Map Linux RESTART* values (512,513,514) to EINTR
16742 +static u_char lnx_err_table[] = {
16743 + /* 512 - 514 */ EINTR, EINTR, EINTR
16746 +static struct map_segment wyse_err_map[] = {
16747 + { 0, 0 + sizeof(wyse_err_table) - 1, wyse_err_table },
16748 + { 512, 512 + sizeof(lnx_err_table) - 1, lnx_err_table },
16752 +static long linux_to_wyse_signals[NSIGNALS+1] = {
16753 +/* 0 - 3 */ 0, IBCS_SIGHUP, IBCS_SIGINT, IBCS_SIGQUIT,
16754 +/* 4 - 7 */ IBCS_SIGILL, IBCS_SIGTRAP, IBCS_SIGABRT, -1,
16755 +/* 8 - 11 */ IBCS_SIGFPE, IBCS_SIGKILL, IBCS_SIGUSR1, IBCS_SIGSEGV,
16756 +/* 12 - 15 */ IBCS_SIGUSR2, IBCS_SIGPIPE, IBCS_SIGALRM, IBCS_SIGTERM,
16757 +/* 16 - 19 */ IBCS_SIGSEGV, IBCS_SIGCHLD, IBCS_SIGCONT, IBCS_SIGSTOP,
16758 +/* 20 - 23 */ IBCS_SIGTSTP, IBCS_SIGTTIN, IBCS_SIGTTOU, IBCS_SIGURG,
16759 +/* 24 - 27 */ IBCS_SIGGXCPU, IBCS_SIGGXFSZ, IBCS_SIGVTALRM, IBCS_SIGPROF,
16760 +/* 28 - 31 */ IBCS_SIGWINCH, IBCS_SIGIO, IBCS_SIGPWR, -1,
16764 +static long wyse_to_linux_signals[NSIGNALS+1] = {
16765 +/* 0 - 3 */ 0, SIGHUP, SIGINT, SIGQUIT,
16766 +/* 4 - 7 */ SIGILL, SIGTRAP, SIGIOT, SIGUNUSED,
16767 +/* 8 - 11 */ SIGFPE, SIGKILL, SIGUNUSED, SIGSEGV,
16768 +/* 12 - 15 */ SIGUNUSED, SIGPIPE, SIGALRM, SIGTERM,
16769 +/* 16 - 19 */ SIGUSR1, SIGUSR2, SIGCHLD, SIGPWR,
16770 +/* 20 - 23 */ SIGWINCH, SIGURG, SIGPOLL, SIGSTOP,
16771 +/* 24 - 27 */ SIGTSTP, SIGCONT, SIGTTIN, SIGTTOU,
16772 +/* 28 - 31 */ SIGVTALRM, SIGPROF, SIGXCPU, SIGXFSZ,
16776 +static char wyse_socktype[] = {
16785 +static struct map_segment wyse_socktype_map[] = {
16786 + { 1, 6, wyse_socktype },
16790 +static struct map_segment wyse_sockopt_map[] = {
16791 + { 0x0001, 0x0001, (char *)SO_DEBUG },
16792 + { 0x0002, 0x0002, (char *)__SO_ACCEPTCON },
16793 + { 0x0004, 0x0004, (char *)SO_REUSEADDR },
16794 + { 0x0008, 0x0008, (char *)SO_KEEPALIVE },
16795 + { 0x0010, 0x0010, (char *)SO_DONTROUTE },
16796 + { 0x0020, 0x0020, (char *)SO_BROADCAST },
16797 + { 0x0040, 0x0040, (char *)SO_USELOOPBACK },
16798 + { 0x0080, 0x0080, (char *)SO_LINGER },
16799 + { 0x0100, 0x0100, (char *)SO_OOBINLINE },
16800 + { 0x0200, 0x0200, (char *)SO_ORDREL },
16801 + { 0x0400, 0x0400, (char *)SO_IMASOCKET },
16802 + { 0x1001, 0x1001, (char *)SO_SNDBUF },
16803 + { 0x1002, 0x1002, (char *)SO_RCVBUF },
16804 + { 0x1003, 0x1003, (char *)SO_SNDLOWAT },
16805 + { 0x1004, 0x1004, (char *)SO_RCVLOWAT },
16806 + { 0x1005, 0x1005, (char *)SO_SNDTIMEO },
16807 + { 0x1006, 0x1006, (char *)SO_RCVTIMEO },
16808 + { 0x1007, 0x1007, (char *)SO_ERROR },
16809 + { 0x1008, 0x1008, (char *)SO_TYPE },
16810 + { 0x1009, 0x1009, (char *)SO_PROTOTYPE },
16814 +static struct map_segment wyse_af_map[] = {
16820 +static struct sysent wyse_nfscall_table[] = {
16821 +/* 0 */ { 0, Ukn, "nfs_svc", "" },
16822 +/* 1 */ { 0, Ukn, "async_daemon", "" },
16823 +/* 2 */ { 0, Ukn, "nfs_getfh", "" },
16824 +/* 3 */ { 0, Ukn, "nfsmount", "" },
16827 +static struct sysent wyse_tcpcall_table[] = {
16828 +/* 0 */ { sys_select, 5, "select", "dxxxx" },
16829 +/* 1 */ { wyse_socket, 3, "socket", "ddd" },
16830 +/* 2 */ { sys_connect, 3, "connect", "dxd" },
16831 +/* 3 */ { sys_accept, 3, "accept", "dxx" },
16832 +/* 4 */ { wyse_send, 4, "send", "dxdd" },
16833 +/* 5 */ { wyse_recv, 4, "recv", "dxdd" },
16834 +/* 6 */ { sys_bind, 3, "bind", "dxd" },
16835 +/* 7 */ { wyse_setsockopt, 5, "setsockopt", "dddxx" },
16836 +/* 8 */ { sys_listen, 2, "listen", "dd" },
16837 +/* 9 */ { 0, 3, "recvmsg", "dxd" },
16838 +/* 10 */ { 0, 3, "sendmsg", "dxd" },
16839 +/* 11 */ { wyse_getsockopt, 5, "getsockopt", "dddxx" },
16840 +/* 12 */ { wyse_recvfrom, 6, "recvfrom", "dxddxd"},
16841 +/* 13 */ { wyse_sendto, 6, "sendto", "dxddxd"},
16842 +/* 14 */ { sys_shutdown, 2, "shutdown", "dd" },
16843 +/* 15 */ { sys_socketpair, 4, "socketpair", "dddx" },
16844 +/* 16 */ { 0, Ukn, "trace", "" },
16845 +/* 17 */ { sys_getpeername, 3, "getpeername", "dxx" },
16846 +/* 18 */ { sys_getsockname, Spl, "getsockname", "dxx" },
16847 +/* 19 */ { wyse_wait3, 1, "wait3", "x" },
16851 +static struct sysent wyse_syscall_table[] = {
16852 +/* 0 */ { abi_syscall, Fast, "syscall", "" },
16853 +/* 1 */ { sys_exit, 1, "exit", "d" },
16854 +/* 2 */ { abi_fork, Spl, "fork", "" },
16855 +/* 3 */ { abi_read, 3, "read", "dpd" },
16856 +/* 4 */ { sys_write, 3, "write", "dpd" },
16857 +/* 5 */ { svr4_open, 3, "open", "soo" },
16858 +/* 6 */ { sys_close, 1, "close", "d" },
16859 +/* 7 */ { abi_wait, Spl, "wait", "xxx" },
16860 +/* 8 */ { sys_creat, 2, "creat", "so" },
16861 +/* 9 */ { sys_link, 2, "link", "ss" },
16862 +/* 10 */ { sys_unlink, 1, "unlink", "s" },
16863 +/* 11 */ { abi_exec, Spl, "exec", "sxx" },
16864 +/* 12 */ { sys_chdir, 1, "chdir", "s" },
16865 +/* 13 */ { abi_time, 0, "time", "" },
16866 +/* 14 */ { svr4_mknod, 3, "mknod", "soo" },
16867 +/* 15 */ { sys_chmod, 2, "chmod", "so" },
16868 +/* 16 */ { sys_chown, 3, "chown", "sdd" },
16869 +/* 17 */ { abi_brk, 1, "brk/break", "x" },
16870 +/* 18 */ { svr4_stat, 2, "stat", "sp" },
16871 +/* 19 */ { sys_lseek, 3, "seek/lseek", "ddd" },
16872 +/* 20 */ { abi_getpid, Spl, "getpid", "" },
16873 +/* 21 */ { 0, Ukn, "mount", "" },
16874 +/* 22 */ { sys_umount, 1, "umount", "s" },
16875 +/* 23 */ { sys_setuid, 1, "setuid", "d" },
16876 +/* 24 */ { abi_getuid, Spl, "getuid", "" },
16877 +/* 25 */ { sys_stime, 1, "stime", "d" },
16878 +/* 26 */ { wyse_ptrace, 4, "ptrace", "xdxx" },
16879 +/* 27 */ { sys_alarm, 1, "alarm", "d" },
16880 +/* 28 */ { svr4_fstat, 2, "fstat", "dp" },
16881 +/* 29 */ { sys_pause, 0, "pause", "" },
16882 +/* 30 */ { sys_utime, 2, "utime", "xx" },
16883 +/* 31 */ { 0, Ukn, "stty", "" }, /* 31 */
16884 +/* 32 */ { 0, Ukn, "gtty", "" },
16885 +/* 33 */ { sys_access, 2, "access", "so" },
16886 +/* 34 */ { sys_nice, 1, "nice", "d" },
16887 +/* 35 */ { svr4_statfs, 4, "statfs", "spdd" },
16888 +/* 36 */ { sys_sync, 0, "sync", "" },
16889 +/* 37 */ { abi_kill, 2, "kill", "dd" },
16890 +/* 38 */ { svr4_fstatfs, 4, "fstatfs", "dpdd" },
16891 +/* 39 */ { abi_procids, Spl, "procids", "d" },
16892 +/* 40 */ { 0, Ukn, "cxenix", "" },
16893 +/* 41 */ { sys_dup, 1, "dup", "d" },
16894 +/* 42 */ { abi_pipe, Spl, "pipe", "" },
16895 +/* 43 */ { sys_times, 1, "times", "p" },
16896 +/* 44 */ { 0, 4, "prof", "xxxx" },
16897 +/* 45 */ { 0, Ukn, "lock/plock", "" },
16898 +/* 46 */ { sys_setgid, 1, "setgid", "d" },
16899 +/* 47 */ { abi_getgid, Spl, "getgid", "" },
16900 +/* 48 */ { abi_sigfunc, Fast, "sigfunc", "xxx" },
16901 +/* 49 */ { svr4_msgsys, Spl, "msgsys", "dxddd" },
16902 +/* 50 */ { svr4_sysi86, 3, "sysi86/sys3b", "d" },
16903 +/* 51 */ { sys_acct, 1, "acct/sysacct", "x" },
16904 +/* 52 */ { svr4_shmsys, Fast, "shmsys", "ddxo" },
16905 +/* 53 */ { svr4_semsys, Spl, "semsys", "dddx" },
16906 +/* 54 */ { svr4_ioctl, Spl, "ioctl", "dxx" },
16907 +/* 55 */ { 0, 3, "uadmin", "xxx" },
16908 +/* 56 */ { 0, Ukn, "?", "" },
16909 +/* 57 */ { v7_utsname, 1, "utsys", "x" },
16910 +/* 58 */ { sys_fsync, 1, "fsync", "d" },
16911 +/* 59 */ { abi_exec, Spl, "execv", "spp" },
16912 +/* 60 */ { sys_umask, 1, "umask", "o" },
16913 +/* 61 */ { sys_chroot, 1, "chroot", "s" },
16914 +/* 62 */ { svr4_fcntl, 3, "fcntl", "dxx" },
16915 +/* 63 */ { svr4_ulimit, 2, "ulimit", "xx" },
16916 +/* 64 */ { 0, Ukn, "?", "" },
16917 +/* 65 */ { 0, Ukn, "?", "" },
16918 +/* 66 */ { 0, Ukn, "?", "" },
16919 +/* 67 */ { 0, Ukn, "?", "" },
16920 +/* 68 */ { 0, Ukn, "?", "" },
16921 +/* 69 */ { 0, Ukn, "?", "" },
16922 +/* 70 */ { 0, Ukn, "advfs", "" },
16923 +/* 71 */ { 0, Ukn, "unadvfs", "" },
16924 +/* 72 */ { 0, Ukn, "rmount", "" },
16925 +/* 73 */ { 0, Ukn, "rumount", "" },
16926 +/* 74 */ { 0, Ukn, "rfstart", "" },
16927 +/* 75 */ { 0, Ukn, "?", "" },
16928 +/* 76 */ { 0, Ukn, "rdebug", "" },
16929 +/* 77 */ { 0, Ukn, "rfstop", "" },
16930 +/* 78 */ { 0, Ukn, "rfsys", "" },
16931 +/* 79 */ { sys_rmdir, 1, "rmdir", "s" },
16932 +/* 80 */ { abi_mkdir, 2, "mkdir", "so" },
16933 +/* 81 */ { svr4_getdents, 3, "getdents", "dxd" },
16934 +/* 82 */ { 0, Ukn, "libattach", "" },
16935 +/* 83 */ { 0, Ukn, "libdetach", "" },
16936 +/* 84 */ { svr4_sysfs, 3, "sysfs", "dxx" },
16937 +/* 85 */ { svr4_getmsg, Spl, "getmsg", "dxxx" },
16938 +/* 86 */ { svr4_putmsg, Spl, "putmsg", "dxxd" },
16939 +/* 87 */ { sys_poll, 3, "poll", "xdd" },
16940 +/* 88 */ { 0, Ukn, "nosys88", "" },
16941 +/* 89 */ { 0, Ukn, "nosys89", "" },
16942 +/* 90 */ { 0, Ukn, "nosys90", "" },
16943 +/* 91 */ { 0, Ukn, "nosys91", "" },
16944 +/* 92 */ { 0, Ukn, "nosys92", "" },
16945 +/* 93 */ { 0, Ukn, "nosys93", "" },
16946 +/* 94 */ { 0, Ukn, "nosys94", "" },
16947 +/* 95 */ { 0, Ukn, "nosys95", "" },
16948 +/* 96 */ { 0, Ukn, "nosys96", "" },
16949 +/* 97 */ { 0, Ukn, "nosys97", "" },
16950 +/* 98 */ { 0, Ukn, "nosys98", "" },
16951 +/* 99 */ { 0, Ukn, "nosys99", "" },
16952 +/* 100 */ { 0, Ukn, "nosys100", "" },
16953 +/* 101 */ { 0, Ukn, "nosys101", "" },
16954 +/* 102 */ { 0, Ukn, "nosys102", "" },
16955 +/* 103 */ { 0, Ukn, "nosys103", "" },
16956 +/* 104 */ { 0, Ukn, "nosys104", "" },
16957 +/* 105 */ { 0, Ukn, "nosys105", "" },
16958 +/* 106 */ { 0, Ukn, "nosys106", "" },
16959 +/* 107 */ { 0, Ukn, "nosys107", "" },
16960 +/* 108 */ { 0, Ukn, "nosys108", "" },
16961 +/* 109 */ { 0, Ukn, "nosys109", "" },
16962 +/* 110 */ { 0, Ukn, "nosys110", "" },
16963 +/* 111 */ { 0, Ukn, "nosys111", "" },
16964 +/* 112 */ { 0, Ukn, "nosys112", "" },
16965 +/* 113 */ { 0, Ukn, "nosys113", "" },
16966 +/* 114 */ { 0, Ukn, "nosys114", "" },
16967 +/* 115 */ { 0, Ukn, "nosys115", "" },
16968 +/* 116 */ { 0, Ukn, "nosys116", "" },
16969 +/* 117 */ { 0, Ukn, "nosys117", "" },
16970 +/* 118 */ { 0, Ukn, "nosys118", "" },
16971 +/* 119 */ { 0, Ukn, "nosys119", "" },
16972 +/* 120 */ { 0, Ukn, "nosys120", "" },
16973 +/* 121 */ { 0, Ukn, "nosys121", "" },
16974 +/* 122 */ { 0, Ukn, "nosys122", "" },
16975 +/* 123 */ { 0, Ukn, "nosys123", "" },
16976 +/* 124 */ { 0, Ukn, "nosys124", "" },
16977 +/* 125 */ { 0, Ukn, "nosys125", "" },
16978 +/* 126 */ { 0, Ukn, "nosys126", "" },
16979 +/* 127 */ { 0, Ukn, "nosys127", "" },
16980 +/* 128 */ { svr4_lstat, 2, "lstat", "sp" },
16981 +/* 129 */ { sys_readlink, 3, "readlink", "spd" },
16982 +/* 130 */ { sys_symlink, 2, "symlink", "ss" },
16983 +/* 131 */ { wyse_class_tcp, Fast, "", "" },
16984 +/* 132 */ { wyse_class_nfs, Fast, "", "" },
16985 +/* 133 */ { wyse_gethostname, 2, "gethostname", "xd" },
16986 +/* 134 */ { sys_sethostname, 2, "sethostname", "sd" },
16987 +/* 135 */ { wyse_getdomainname, 2, "getdomainname","xd" },
16988 +/* 136 */ { sys_setdomainname, 2, "setdomainname","sd" },
16989 +/* 137 */ { 0, Ukn, "?", "" },
16990 +/* 138 */ { sys_setreuid, 2, "setreuid", "dd" },
16991 +/* 139 */ { sys_setregid, 2, "setregid", "dd" },
16995 +wyse_class_nfs(struct pt_regs *regs)
16998 + int sysno = regs->eax >> 8;
17000 + if (sysno >= ARRAY_SIZE(wyse_nfscall_table))
17001 + set_error(regs, iABI_errors(-EINVAL));
17003 + lcall7_dispatch(regs, &wyse_nfscall_table[sysno], 1);
17007 +wyse_class_tcp(struct pt_regs *regs)
17009 + int sysno = regs->eax >> 8;
17011 + if (sysno >= ARRAY_SIZE(wyse_tcpcall_table))
17012 + set_error(regs, iABI_errors(-EINVAL));
17014 + lcall7_dispatch(regs, &wyse_tcpcall_table[sysno], 1);
17018 +wyse_lcall7(int segment, struct pt_regs *regs)
17020 + int sysno = regs->eax & 0xff;
17022 + if (sysno >= ARRAY_SIZE(wyse_syscall_table))
17023 + set_error(regs, iABI_errors(-EINVAL));
17025 + lcall7_dispatch(regs, &wyse_syscall_table[sysno], 1);
17028 +static struct exec_domain wyse_exec_domain = {
17029 + name: "Wyse/386",
17030 + handler: wyse_lcall7,
17031 + pers_low: 4 /* PER_WYSEV386 */,
17032 + pers_high: 4 /* PER_WYSEV386 */,
17033 + signal_map: wyse_to_linux_signals,
17034 + signal_invmap: linux_to_wyse_signals,
17035 + err_map: wyse_err_map,
17036 + socktype_map: wyse_socktype_map,
17037 + sockopt_map: wyse_sockopt_map,
17038 + af_map: wyse_af_map,
17039 + module: THIS_MODULE
17044 +wyse_module_init(void)
17046 + return register_exec_domain(&wyse_exec_domain);
17049 +static void __exit
17050 +wyse_module_exit(void)
17052 + unregister_exec_domain(&wyse_exec_domain);
17055 +module_init(wyse_module_init);
17056 +module_exit(wyse_module_exit);
17057 diff -Nru linux-2.6.7/abi/wyse/syslocal.c linux-2.6.7-abi/abi/wyse/syslocal.c
17058 --- linux-2.6.7/abi/wyse/syslocal.c 1970-01-01 01:00:00.000000000 +0100
17059 +++ linux-2.6.7-abi/abi/wyse/syslocal.c 2004-07-22 17:44:21.000000000 +0200
17062 + * Copyright (C) 1994 Mike Jagdis (jaggy@purplet.demon.co.uk)
17067 +#include <linux/module.h>
17068 +#include <linux/errno.h>
17069 +#include <asm/uaccess.h>
17071 +#include <abi/util/trace.h>
17075 + * The syslocal() call is used for machine specific functions. For
17076 + * instance on a Wyse 9000 it give information and control of the
17077 + * available processors.
17079 +#define SL_ONLINE 0 /* Turn processor online */
17080 +#define SL_OFFLINE 1 /* Turn processor offline */
17081 +#define SL_QUERY 2 /* Query processor status */
17082 +#define SL_NENG 3 /* Return No. of processors configured */
17083 +#define SL_AFFINITY 4 /* processor binding */
17084 +#define SL_CMC_STAT 7 /* gather CMC performance counters info */
17085 +#define SL_KACC 8 /* make kernel data readable by user */
17086 +#define SL_MACHTYPE 9 /* return machine type (MP/AT) */
17087 +#define SL_BOOTNAME 10 /* return name of booted kernel */
17088 +#define SL_BOOTDEV 11 /* return type of booted device */
17089 +#define SL_UQUERY 12 /* query user status */
17091 +#define SL_MACH_MP 0
17092 +#define SL_MACH_AT 1
17093 +#define SL_MACH_EISA 2
17094 +#define SL_MACH_EMP 3
17098 +wyse_syslocal(struct pt_regs *regp)
17100 + int cmd = get_syscall_parameter(regp, 0);
17107 + case SL_MACHTYPE:
17108 + return (EISA_bus ? SL_MACH_EISA : SL_MACH_AT);
17111 +#if defined(CONFIG_ABI_TRACE)
17112 + abi_trace(ABI_TRACE_UNIMPL, "unsupported syslocal call %d\n", cmd);
17116 diff -Nru linux-2.6.7/arch/i386/kernel/i386_ksyms.c linux-2.6.7-abi/arch/i386/kernel/i386_ksyms.c
17117 --- linux-2.6.7/arch/i386/kernel/i386_ksyms.c 2004-06-16 07:20:26.000000000 +0200
17118 +++ linux-2.6.7-abi/arch/i386/kernel/i386_ksyms.c 2004-07-22 17:44:21.000000000 +0200
17120 #include <linux/tty.h>
17121 #include <linux/highmem.h>
17122 #include <linux/time.h>
17123 +#define __KERNEL_SYSCALLS__
17124 +#include <linux/unistd.h>
17125 +#include <linux/syscalls.h>
17127 #include <asm/semaphore.h>
17128 #include <asm/processor.h>
17129 @@ -206,3 +209,8 @@
17132 EXPORT_SYMBOL(csum_partial);
17134 +EXPORT_SYMBOL(sys_modify_ldt);
17135 +EXPORT_SYMBOL(sys_ptrace);
17136 +EXPORT_SYMBOL(sys_ipc);
17137 +EXPORT_SYMBOL(sys_pause);
17138 diff -Nru linux-2.6.7/arch/i386/kernel/lcall7.c linux-2.6.7-abi/arch/i386/kernel/lcall7.c
17139 --- linux-2.6.7/arch/i386/kernel/lcall7.c 1970-01-01 01:00:00.000000000 +0100
17140 +++ linux-2.6.7-abi/arch/i386/kernel/lcall7.c 2004-07-22 17:44:21.000000000 +0200
17143 + * Copyright (c) 2000,2001 Christoph Hellwig.
17144 + * Copyright (c) 2001 Caldera Deutschland GmbH.
17145 + * All rights resered.
17147 + * This program is free software; you can redistribute it and/or modify
17148 + * it under the terms of the GNU General Public License as published by
17149 + * the Free Software Foundation; either version 2 of the License, or
17150 + * (at your option) any later version.
17152 + * This program is distributed in the hope that it will be useful,
17153 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
17154 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17155 + * GNU General Public License for more details.
17157 + * You should have received a copy of the GNU General Public License
17158 + * along with this program; if not, write to the Free Software
17159 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17165 + * Lowlevel handler for lcall7-based syscalls.
17167 +#include <linux/module.h>
17168 +#include <linux/errno.h>
17169 +#include <linux/sched.h>
17170 +#include <linux/kernel.h>
17171 +#include <linux/mm.h>
17172 +#include <linux/ptrace.h>
17173 +#include <linux/init.h>
17174 +#include <linux/personality.h>
17175 +#include <asm/uaccess.h>
17177 +#include <abi/util/errno.h>
17178 +#include <abi/util/trace.h>
17179 +#include <abi/util/sysent.h>
17181 +MODULE_AUTHOR("Christoph Hellwig");
17182 +MODULE_DESCRIPTION("Lowlevel handler for lcall7-based syscalls");
17183 +MODULE_LICENSE("GPL");
17186 +static void get_args(int args[], struct pt_regs *regs, int of, int n)
17190 + for (i = 0; i < n; i++)
17191 + get_user(args[i], ((unsigned long *)regs->esp) + (i+of));
17195 + * lcall7_syscall - indirect syscall for the lcall7 entry point
17197 + * @regs: saved user registers
17199 + * This function implements syscall(2) in kernelspace for the lcall7-
17200 + * based personalities.
17203 +int lcall7_syscall(struct pt_regs *regs)
17205 + __get_user(regs->eax, ((unsigned long *)regs->esp)+1);
17208 + current_thread_info()->exec_domain->handler(-1,regs);
17215 + * lcall7_dispatch - handle lcall7-based syscall entry
17217 + * @regs: saved user registers
17218 + * @ap: syscall table entry
17219 + * @off: argument offset
17221 + * This function handles lcall7-based syscalls after the personality-
17222 + * specific rountine selected the right syscall table entry.
17225 +void lcall7_dispatch(struct pt_regs *regs, struct sysent *ap, int off)
17227 + short nargs = ap->se_nargs;
17228 + int args[8], error;
17230 + if (!ap->se_syscall) /* XXX kludge XXX */
17233 + if (nargs <= ARRAY_SIZE(args))
17234 + get_args(args, regs, off, nargs);
17236 +#if defined(CONFIG_ABI_TRACE)
17237 + if (abi_traced(ABI_TRACE_API)) {
17238 + if (nargs == Spl)
17239 + get_args(args, regs, off, strlen(ap->se_args));
17240 + plist(ap->se_name, ap->se_args, args);
17246 + SYSCALL_PREGS(ap->se_syscall, regs);
17247 + goto show_signals;
17249 + error = SYSCALL_PREGS(ap->se_syscall, regs);
17252 + error = SYSCALL_VOID(ap->se_syscall);
17255 + error = SYSCALL_1ARG(ap->se_syscall, args);
17258 + error = SYSCALL_2ARG(ap->se_syscall, args);
17261 + error = SYSCALL_3ARG(ap->se_syscall, args);
17264 + error = SYSCALL_4ARG(ap->se_syscall, args);
17267 + error = SYSCALL_5ARG(ap->se_syscall, args);
17270 + error = SYSCALL_6ARG(ap->se_syscall, args);
17273 + error = SYSCALL_7ARG(ap->se_syscall, args);
17276 +#if defined(CONFIG_ABI_TRACE)
17277 + abi_trace(ABI_TRACE_UNIMPL,
17278 + "Unsupported ABI function 0x%lx (%s)\n",
17279 + regs->eax, ap->se_name);
17284 + if (error > -ENOIOCTLCMD && error < 0) {
17285 + set_error(regs, iABI_errors(-error));
17287 +#if defined(CONFIG_ABI_TRACE)
17288 + abi_trace(ABI_TRACE_API,
17289 + "%s error return %d/%ld\n",
17290 + ap->se_name, error, regs->eax);
17293 + clear_error(regs);
17294 + set_result(regs, error);
17296 +#if defined(CONFIG_ABI_TRACE)
17297 + abi_trace(ABI_TRACE_API,
17298 + "%s returns %ld (edx:%ld)\n",
17299 + ap->se_name, regs->eax, regs->edx);
17304 +#if defined(CONFIG_ABI_TRACE)
17305 + if (signal_pending(current) && abi_traced(ABI_TRACE_SIGNAL)) {
17306 + unsigned long signr;
17308 + signr = current->pending.signal.sig[0] &
17309 + ~current->blocked.sig[0];
17311 + __asm__("bsf %1,%0\n\t"
17315 + __abi_trace("SIGNAL %lu, queued 0x%08lx\n",
17316 + signr+1, current->pending.signal.sig[0]);
17322 +#if defined(CONFIG_ABI_SYSCALL_MODULES)
17323 +EXPORT_SYMBOL(lcall7_syscall);
17324 +EXPORT_SYMBOL(lcall7_dispatch);
17326 diff -Nru linux-2.6.7/arch/i386/kernel/Makefile linux-2.6.7-abi/arch/i386/kernel/Makefile
17327 --- linux-2.6.7/arch/i386/kernel/Makefile 2004-06-16 07:19:01.000000000 +0200
17328 +++ linux-2.6.7-abi/arch/i386/kernel/Makefile 2004-07-22 17:44:21.000000000 +0200
17330 obj-$(CONFIG_X86_IO_APIC) += io_apic.o
17331 obj-$(CONFIG_X86_NUMAQ) += numaq.o
17332 obj-$(CONFIG_X86_SUMMIT_NUMA) += summit.o
17333 +obj-$(CONFIG_ABI_LCALL7) += lcall7.o
17334 obj-$(CONFIG_MODULES) += module.o
17335 obj-y += sysenter.o vsyscall.o
17336 obj-$(CONFIG_ACPI_SRAT) += srat.o
17337 diff -Nru linux-2.6.7/arch/i386/kernel/traps.c linux-2.6.7-abi/arch/i386/kernel/traps.c
17338 --- linux-2.6.7/arch/i386/kernel/traps.c 2004-06-16 07:19:01.000000000 +0200
17339 +++ linux-2.6.7-abi/arch/i386/kernel/traps.c 2004-07-22 17:44:21.000000000 +0200
17340 @@ -588,6 +588,26 @@
17342 __asm__ __volatile__("movl %%db6,%0" : "=r" (condition));
17345 + * Entering the kernel via lcall7 or lcall27 does not clear the TF bit.
17346 + * Leaving it set in kernel code will stop the machine. The first
17347 + * instructions of lcall7 and lcall27 in entry.S save the CPU flags.
17348 + * The saved flags should have the TF bit set, so we ignore this trap.
17350 + if (regs->eip == (unsigned long) &lcall7 ||
17351 + regs->eip == (unsigned long) &lcall27)
17355 + * After having saved the flags, TF will fire the single step trap
17356 + * again. This time TF should be cleared. It will be restored by the
17357 + * iret instruction returning to user mode. This way, the very next
17358 + * instruction after lcall in the user programm will not be stopped at.
17360 + if (regs->eip - 1 == (unsigned long) &lcall7 || /* pushfl is a one-byte op */
17361 + regs->eip - 1 == (unsigned long) &lcall27)
17364 /* It's safe to allow irq's after DR6 has been saved */
17365 if (regs->eflags & X86_EFLAGS_IF)
17366 local_irq_enable();
17367 diff -Nru linux-2.6.7/arch/ia64/ia32/ia32priv.h linux-2.6.7-abi/arch/ia64/ia32/ia32priv.h
17368 --- linux-2.6.7/arch/ia64/ia32/ia32priv.h 2004-06-16 07:20:19.000000000 +0200
17369 +++ linux-2.6.7-abi/arch/ia64/ia32/ia32priv.h 2004-07-22 17:44:21.000000000 +0200
17370 @@ -332,7 +332,7 @@
17373 # define SET_PERSONALITY(EX,IBCS2) \
17374 - (current->personality = (IBCS2) ? PER_SVR4 : PER_LINUX)
17375 + (is_cur_personality((IBCS2)) ? PER_SVR4 : PER_LINUX)
17378 #define IA32_EFLAG 0x200
17379 diff -Nru linux-2.6.7/arch/parisc/kernel/signal.c linux-2.6.7-abi/arch/parisc/kernel/signal.c
17380 --- linux-2.6.7/arch/parisc/kernel/signal.c 2004-06-16 07:20:19.000000000 +0200
17381 +++ linux-2.6.7-abi/arch/parisc/kernel/signal.c 2004-07-22 17:44:21.000000000 +0200
17384 compat_sigset_t newset32;
17386 - if(personality(current->personality) == PER_LINUX32){
17387 + if(is_cur_personality_id(PERID_LINUX32)){
17388 /* XXX: Don't preclude handling different sized sigset_t's. */
17389 if (sigsetsize != sizeof(compat_sigset_t))
17391 @@ -152,7 +152,7 @@
17392 compat_sigset_t compat_set;
17393 struct compat_rt_sigframe * compat_frame;
17395 - if(personality(current->personality) == PER_LINUX32)
17396 + if(is_cur_personality_id(PERID_LINUX32))
17397 sigframe_size = PARISC_RT_SIGFRAME_SIZE32;
17400 @@ -165,7 +165,7 @@
17402 compat_frame = (struct compat_rt_sigframe *)frame;
17404 - if(personality(current->personality) == PER_LINUX32){
17405 + if(is_cur_personality_id(PERID_LINUX32)){
17406 DBG(2,"sys_rt_sigreturn: ELF32 process.\n");
17407 if (__copy_from_user(&compat_set, &compat_frame->uc.uc_sigmask, sizeof(compat_set)))
17409 @@ -185,7 +185,7 @@
17411 /* Good thing we saved the old gr[30], eh? */
17413 - if(personality(current->personality) == PER_LINUX32){
17414 + if(is_cur_personality_id(PERID_LINUX32)){
17415 DBG(1,"sys_rt_sigreturn: compat_frame->uc.uc_mcontext 0x%p\n",
17416 &compat_frame->uc.uc_mcontext);
17417 // FIXME: Load upper half from register file
17418 @@ -315,7 +315,7 @@
17420 compat_frame = (struct compat_rt_sigframe *)frame;
17422 - if(personality(current->personality) == PER_LINUX32) {
17423 + if(is_personality_id(PERID_LINUX32)) {
17424 DBG(1,"setup_rt_frame: frame->info = 0x%p\n", &compat_frame->info);
17425 err |= compat_copy_siginfo_to_user(&compat_frame->info, info);
17426 DBG(1,"SETUP_RT_FRAME: 1\n");
17427 @@ -392,7 +392,7 @@
17428 haddr = A(ka->sa.sa_handler);
17429 /* The sa_handler may be a pointer to a function descriptor */
17431 - if(personality(current->personality) == PER_LINUX32) {
17432 + if(is_cur_personality_id(PERID_LINUX32)) {
17434 if (haddr & PA_PLABEL_FDESC) {
17436 @@ -427,19 +427,19 @@
17438 sigframe_size = PARISC_RT_SIGFRAME_SIZE;
17440 - if(personality(current->personality) == PER_LINUX32)
17441 + if(is_cur_personality_id(PERID_LINUX32))
17442 sigframe_size = PARISC_RT_SIGFRAME_SIZE32;
17445 regs->gr[31] = haddr;
17447 - if(personality(current->personality) == PER_LINUX)
17448 + if(is_cur_personality_id(PERID_LINUX))
17449 sigframe_size |= 1;
17452 unsigned long psw = USER_PSW;
17454 - if(personality(current->personality) == PER_LINUX)
17455 + if(is_cur_personality_id(PERID_LINUX))
17459 @@ -452,7 +452,7 @@
17460 regs->gr[26] = sig; /* signal number */
17463 - if(personality(current->personality) == PER_LINUX32){
17464 + if(is_cur_personality_id(PERID_LINUX32)){
17465 regs->gr[25] = A(&compat_frame->info); /* siginfo pointer */
17466 regs->gr[24] = A(&compat_frame->uc); /* ucontext pointer */
17468 diff -Nru linux-2.6.7/arch/x86_64/ia32/sys_ia32.c linux-2.6.7-abi/arch/x86_64/ia32/sys_ia32.c
17469 --- linux-2.6.7/arch/x86_64/ia32/sys_ia32.c 2004-06-16 07:19:22.000000000 +0200
17470 +++ linux-2.6.7-abi/arch/x86_64/ia32/sys_ia32.c 2004-07-22 17:44:21.000000000 +0200
17471 @@ -924,12 +924,15 @@
17472 sys32_personality(unsigned long personality)
17475 - if (personality(current->personality) == PER_LINUX32 &&
17477 + if (is_personality_id(PERID_LINUX32) &&
17478 personality == PER_LINUX)
17479 personality = PER_LINUX32;
17480 ret = sys_personality(personality);
17482 if (ret == PER_LINUX32)
17488 @@ -1077,7 +1080,7 @@
17489 __put_user(0,name->version+__OLD_UTS_LEN);
17491 char *arch = "x86_64";
17492 - if (personality(current->personality) == PER_LINUX32)
17493 + if (is_cur_personality_id(PERID_LINUX32))
17496 __copy_to_user(&name->machine,arch,strlen(arch)+1);
17497 @@ -1098,7 +1101,7 @@
17498 down_read(&uts_sem);
17499 err=copy_to_user(name, &system_utsname, sizeof (*name));
17501 - if (personality(current->personality) == PER_LINUX32)
17502 + if (is_cur_personality_id(PERID_LINUX32))
17503 err |= copy_to_user(&name->machine, "i686", 5);
17504 return err?-EFAULT:0;
17506 diff -Nru linux-2.6.7/arch/x86_64/kernel/sys_x86_64.c linux-2.6.7-abi/arch/x86_64/kernel/sys_x86_64.c
17507 --- linux-2.6.7/arch/x86_64/kernel/sys_x86_64.c 2004-06-16 07:19:37.000000000 +0200
17508 +++ linux-2.6.7-abi/arch/x86_64/kernel/sys_x86_64.c 2004-07-22 17:44:21.000000000 +0200
17509 @@ -148,7 +148,7 @@
17510 down_read(&uts_sem);
17511 err = copy_to_user(name, &system_utsname, sizeof (*name));
17513 - if (personality(current->personality) == PER_LINUX32)
17514 + if (is_cur_personality_id(PERID_LINUX32))
17515 err |= copy_to_user(&name->machine, "i686", 5);
17516 return err ? -EFAULT : 0;
17518 diff -Nru linux-2.6.7/Documentation/abi/00-INDEX linux-2.6.7-abi/Documentation/abi/00-INDEX
17519 --- linux-2.6.7/Documentation/abi/00-INDEX 1970-01-01 01:00:00.000000000 +0100
17520 +++ linux-2.6.7-abi/Documentation/abi/00-INDEX 2004-07-22 17:44:20.000000000 +0200
17525 + - a list of software that has run succesfull under iBCS
17527 + - a list of people that have contributed to linux-abi or iBCS
17529 + - changelog of linux-abi
17531 + - changelog of the iBCS project (up to 1998)
17533 + - mapping of error codes from Linux to various personalities
17537 + - help on local X interfaces
17539 + - some notes on signal handling
17541 + - an introduction into Linux personality support
17543 + - read this first!
17545 + - the syscall mapping for certain personalities
17547 + - things to be done, leftovers from iBCS
17549 + - autoloading personality modules under Linux-ABI
17551 + - a brief overview of the Linux-ABI modules
17552 diff -Nru linux-2.6.7/Documentation/abi/autoload.txt linux-2.6.7-abi/Documentation/abi/autoload.txt
17553 --- linux-2.6.7/Documentation/abi/autoload.txt 1970-01-01 01:00:00.000000000 +0100
17554 +++ linux-2.6.7-abi/Documentation/abi/autoload.txt 2004-07-22 17:44:20.000000000 +0200
17556 +Autoloading personality modules under Linux-ABI
17558 +Christoph Hellwig, <hch@caldera.de>
17560 +Linux-ABI can automatically load binary format modules (see modules.txt
17561 +for information on what binary format modules are). This file explains
17562 +how to setup a system to automatically load the binary format modules
17565 +Automatic module loading is done in Linux using a facility called 'kmod'
17566 +which is - unlike the name suggests - _not_ a system daemon, but a kernel-
17567 +facility to make userspace upcalls to te module loading program 'modprobe'.
17569 +Linux-ABI uses the function request_module that is exported by kmod to
17570 +request modules for personalities that are currently not available but
17571 +requested by one of the binary fomrat detection heuristics. For a missing
17572 +personality, request_module is called for the module-string
17574 + personality-<personality-number>
17576 +To get the right modules loaded you have to alias these string to the
17577 +actually wanted modules in /etc/modules.conf. To do that you have to know
17578 +which personality number maps to what module. Here is a table for the
17579 +personalities supported by Linux-ABI:
17582 + personalities module
17583 + -----------------------------------
17590 +Below is an example snipplet from modules.conf for such a setup:
17592 +------------------- snip --------------------
17594 +alias personality-1 abi-ibcs
17595 +alias personality-2 abi-ibcs
17596 +alias personality-3 abi-sco
17597 +alias personality-4 abi-wyse
17598 +alias personality-5 abi-ibcs
17599 +alias personality-7 abi-ibcs
17600 +alias personality-13 abi-solaris
17601 +alias personality-14 abi-uw7
17603 +------------------- snip --------------------
17605 diff -Nru linux-2.6.7/Documentation/abi/ChangeLog linux-2.6.7-abi/Documentation/abi/ChangeLog
17606 --- linux-2.6.7/Documentation/abi/ChangeLog 1970-01-01 01:00:00.000000000 +0100
17607 +++ linux-2.6.7-abi/Documentation/abi/ChangeLog 2004-07-22 17:44:20.000000000 +0200
17609 +2002-01-03 Christoph Hellwig <hch@caldera.de>
17611 + linux-abiÂ2.4.17.0
17613 + * rework/cleanup lcall7 syscall handling
17614 + * make sure x.out sections aren't loaded into illegal areas
17615 + * fix SVR4 mmap() to always assume post-SunOS4 behaviour
17617 +2001-11-24 Christoph Hellwig <hch@caldera.de>
17619 + linux-abi-2.4.15.0
17621 + * simplify wyse socket handling, use native syscalls directly where
17622 + possibles else use normal calling conventions
17623 + * fix <linux/syscall.h> compilation for non-i386 machines (Olaf Hering)
17624 + * fix alignment checks in binfmt_xout (based on patch by Joerg Ahrens)
17625 + * rewrite abi_brk: fix (theoretical) races, check for page alignment
17626 + * don't try to take a non-existant lock in xnx_nap, cleanup xnx_nap.
17627 + * fix value reported by sysi86(SI86MEM).
17629 +2001-11-18 Christoph Hellwig <hch@sb.bsdonline.org>
17631 + linux-abi 2.4.14.0
17633 + * small binfmt_xout bugfixes (Joerg Ahrens)
17634 + * move isc into it's own personality
17635 + * make all personalities independant of abi-ibcs
17636 + * merge socket handling into abi-wyse
17638 +2001-10-22 Christoph Hellwig <hch@sb.bsdonline.org>
17640 + linux-abi 2.4.12.0
17642 + * big mmap rewrite
17643 + | correctly check for flags in svr4_mmap
17644 + | use svr4_mmap for the UnixWare personality as well
17645 + | OpenServer has it's own implementation now as it supports
17646 + rather different flags than SVR4 & derivates
17647 + * more header cleanups - all helper routines are now in abi/util/*.h
17649 +2001-10-04 Christoph Hellwig <hch@sb.bsdonline.org>
17651 + linux-abi 2.4.10.0
17653 + * add MODULE_DESCRIPTION/MODULE_AUTHOR/MODULE_LICENSE tags
17654 + * don't use alternate prefix for directories (David Mosberger)
17655 + * fix non-modular buil
17656 + * cleanup stat handling
17657 + | use Alexander Viro's kstat concept
17658 + | all emulations now have their own xstat implementations
17659 + | fixed overflows
17660 + * add full-fledged types.h headers for all peronalities
17662 +2001-08-06 Christoph Hellwig <hch@sb.bsdonline.org>
17664 + linux-abi 2.4.9.0
17666 + * fix missing solaris socket exports
17667 + * move Xenix support from ibcs to sco module,
17668 + make unconditional
17669 + * UnixWare LFS fixes
17670 + * make the actual code work on the Alan Cox tree
17672 +2001-08-06 Christoph Hellwig <hch@sb.bsdonline.org>
17674 + linux-abi 2.4.7.0
17676 + * some final polishing for segmented 286 x.out binaries (Joerg Ahrens)
17677 + * fix SPX handling (again)
17678 + * fix setpgrp and cleanup procids while we're at it
17679 + * update SCO syscall table to match OSR506a
17681 +2001-07-19 Christoph Hellwig <hch@sb.bsdonline.org>
17683 + linux-abi 2.4.6.1
17685 + * rewritten /dev/socksys handling
17686 + * fix more non-x86 breakage (Olaf Hering)
17687 + * port solaris native sockets from sparc64
17688 + * add sysctl support for runtime-tweaking
17689 + * add cxenix to the ibcs sysent table for Xenix/386 (Jürgen Günther)
17690 + * (re)add support for segmented x.out binaries (Joerg Ahrens)
17691 + | I probably broke it while rebasing against -CURRENT
17692 + * reject IRIX binaries on mips32 (David Woodhouse)
17694 +2001-07-09 Christoph Hellwig <hch@sb.bsdonline.org>
17696 + linux-abi 2.4.6.0
17698 + * svr4/signal.c typo fix
17699 + * make cxenix debug printk's less verbose (Christian Lademann)
17700 + * misc small bugfixes (Christian Lademann)
17701 + * compile fixes for !CONFIG_ABI on non-x86 architectures
17703 +2001-06-18 Christoph Hellwig <hch@sb.bsdonline.org>
17705 + linux-abi 2.4.5.1
17707 + * rewrite of abi_sigsuspend() to make it work as expected
17708 + * fix cxenix syscall table
17709 + * actually initialize socksys
17711 +2001-06-09 Christoph Hellwig <hch@sb.bsdonline.org>
17713 + linux-abi 2.4.5.0
17715 + * rewrite of kernel exec_domain support
17716 + * make faking of SCO utsname information configurable
17717 + * get rid of SYS() and sysfunc_p (Arjan van de Ven)
17718 + * fix socket families (Stephan Springl)
17719 + * fix SCO signal mapping (Stephan Springl)
17720 + * fix SCO (and Wyse) error mapping
17721 + * continued source tree restructuring
17723 +2001-04-31 Christoph Hellwig <hch@sb.bsdonline.org>
17725 + linux-abi 2.4.4.0
17727 + * disable tracing by default
17728 + * rewrite of the SYSV IPC code
17729 + * add support for SCO OpenServer 5 ELF binaries
17730 + * fix an error in binfmt_coff that does not clear the return value
17731 + * provide generic template macros for stat and friends
17732 + * start of source tree reorganization
17734 +2001-03-30 Christoph Hellwig <hch@sb.bsdonline.org>
17736 + linux-abi 2.4.3.0
17738 + * fix shared library support for COFF
17739 + * x.out is now supported (again)
17740 + * redo setting of personality based on ELF headers
17741 + * get rid of CONFIG_ABI_TRACE (and a lot of nasty ifdefs)
17742 + * added documentation, mostly from iBCS
17744 diff -Nru linux-2.6.7/Documentation/abi/ChangeLog.ibcs linux-2.6.7-abi/Documentation/abi/ChangeLog.ibcs
17745 --- linux-2.6.7/Documentation/abi/ChangeLog.ibcs 1970-01-01 01:00:00.000000000 +0100
17746 +++ linux-2.6.7-abi/Documentation/abi/ChangeLog.ibcs 2004-07-22 17:44:20.000000000 +0200
17748 +Thu Nov 5 21:45:41 GMT 1998
17750 + * Fixed the bug that lets reads and writes on /dev/socksys
17751 + take out the kernel.
17754 + * Added a kludge around for Sybase isql which appears to
17755 + have initialised a struct sockaddr using:
17756 + sa.sa_family = htons(AF_INET);
17757 + I guess this works on SCO?
17761 +Sat Oct 31 14:15:44 GMT 1998
17763 + * Documentation update.
17765 + * If we are doing a T_BIND_REQ with a null address we can
17766 + ignore the connection backlog. Listening makes no sense
17767 + but some software seems to set it 1 for the hell of it.
17771 +Tue Oct 20 20:34:20 BST 1998
17773 + * Changed the debug messages printed when exec tracing
17774 + sees a pointer error on an arg or env entry. It may not
17775 + be a "real" error. It could be that we just cannot get
17776 + a free page or perhaps the entry is too long for getname().
17777 + Whatever, we do not really care at this point anyway.
17781 +Sat Oct 17 20:24:59 BST 1998
17783 + * Documentation update for today's release.
17787 +Thu Oct 15 21:39:16 BST 1998
17789 + * When checking personality only look at the base personality
17790 + and ignore the flags. There is at least one case I can
17791 + think of, PER_SHORT_INODE, where the personality should
17792 + be considered the same even when the flags are different.
17795 + * Added the location of the kernel source as an option
17796 + in the CONFIG. Hopefully this will make it a little
17797 + more obvious that iBCS is *dependant* on the kernel.
17800 + * Set SO_BSDCOMPAT on sockets. SYSV has BSD handling of
17801 + ICMP errors on UDP sockets rather than RFC conformance.
17806 +Wed Oct 14 22:50:48 BST 1998
17808 + * When using some user stack as temporary work space we
17809 + only leave 1k between the work space and the real user
17810 + stack. This is because Informix Dynamic Server uses
17811 + threads with limited stack space and the idea of dropping
17812 + 16k below what would normally be touched on a SCO system
17813 + worries me a bit.
17817 +Sun Oct 11 11:58:58 BST 1998
17819 + * Changed the Tools Makefile to install mkmnttab in
17820 + /usr/bin. Informix Dynamic Server _requires_ a
17821 + valid /etc/mnttab.
17825 +Sun Oct 11 11:44:58 BST 1998
17827 + * When doing an I_PEEK or I_NREAD STREAMS ioctl we have
17828 + to do a probe on sockets in case we need to generate
17829 + a control message (e.g. T_CONN_IND) which should then
17830 + be offered. This also allows T_CONN_IND messages to be
17831 + returned in several MORECTL divided pieces should it
17832 + ever be necessary. This is required by Informix Dynamic
17833 + Server which does a poll then I_PEEK on a listening
17834 + socket before actually picking up the connection. Dynamic
17835 + Server is system call hell :-).
17838 + * When we do a timod operation via an ioctl there seems
17839 + to be no way to cope if the returned message is larger
17840 + than the original request. We can't expect the app to
17841 + come back for the extra and returning MORECTL to the
17842 + app seems to confuse things. Therefore we just discard
17843 + the excess. This case is required when an app (e.g.
17844 + Informix Dynamic Server) tries to set SO_LINGER using
17845 + an int instead of a struct linger via an ioctl.
17848 + * Added some debug to the poll handler so we can see what
17852 + * More debug message changes.
17855 + * Wrap SO_LINGER handling so we can survive if an int is
17856 + passed instead of s struct linger. It seems that other
17857 + systems do not do such robust error checking as Linux.
17858 + Note that if an int is passed we probably do not do what
17859 + other systems would but at least we don't give unexpected
17860 + errors to broken applications.
17864 +Sat Oct 10 15:58:29 BST 1998
17866 + * Added an entry to Doc/HINTS noting the the Informix
17867 + Dynamic Server install requires an /etc/mnttab.
17870 + * Wrong option length being passed through to setsockopt()
17871 + from the TLI/XTI optmgmt routine.
17874 + * When stating files only map "ext2" to "HTFS" for SCO
17875 + programs - and then only if the filesystem name really
17879 + * SCO has a different value for the _SC_PAGESIZE argument
17880 + to sysconf() than SVR4. Informix wants it to work.
17883 + * Hmmm, Informix Dynamic Server may or may not be looking
17884 + at the major number on a socket. (I _think_ it does
17885 + sometimes). It definitely checks that sockets have
17886 + S_IFCHR set in their file modes though...
17889 + * Changed some debug messages to make it easier to read
17890 + logs when more than one iBCS handled process is running.
17893 + * If we get a STREAMS ioctl on a file descriptor only
17894 + initialize the socksys handler on it if it is not
17895 + already a socket but does belong to the socksys device.
17899 +Thu Oct 8 21:20:43 BST 1998
17901 + * When punting a pseudo device transport provider to a
17902 + socket copy the device numbers between the inodes. This
17903 + is because Informix Dynamic Server stats the pseudo
17904 + device node (/dev/socksys) then stats the socket it
17905 + gets and compares the major numbers. Sheesh...
17908 + * If socksys_close gets something that is not a socket
17909 + it is probably the original pseudo device which was
17910 + opened just for an ioctl or two. This is not an error.
17913 + * Some programs, notably the Informix Dynamic Server
17914 + install program compare the filesystem name from a
17915 + stat or sysfs against their own hard coded list of
17916 + known "real" filesystems. Hence we call "ext2" "HTFS"
17917 + instead for SCO processes.
17920 + * Informix DS also checks the release part of the utsname
17921 + data to make sure it says "3.2v5.0.0". So now the
17922 + utsname struct looks even more like SCO.
17925 + * Only dump the ctl part of messages in timod if
17926 + tracing is enabled.
17929 + * SCO has statvfs in the same place as SVR4 but they have
17930 + added a field slap bang in the middle of the struct to
17931 + allow some inodes to be reserved for root in much the
17932 + same way that some blocks may be reserved.
17936 +Thu Oct 8 20:48:46 BST 1998
17938 + * On timod bind and connect the size of the address is
17939 + allowed to be the _used_ bytes whereas the underlying
17940 + socket functions require the _total_ bytes. This is
17941 + a problem for Sybase.
17945 +Sun Aug 30 21:49:46 BST 1998
17947 + * Changed socksys.c to handle new file_operations struct
17948 + in kernel 2.1.119 and later.
17952 +Sat Aug 22 19:57:01 BST 1998
17954 + * Fixes and additions to user pointer checking in ipc.c
17957 + * Changed some more KERN_ERRs to KERN_DEBUGs in the
17958 + STREAMS ioctl support.
17962 +Fri Aug 21 20:24:32 BST 1998
17964 + * Somehow fchdir had been missed from the main iBCS call
17965 + map even though it had been put in the BSD map. Oops.
17969 +Wed Aug 19 23:12:47 BST 1998
17971 + * ALPHA 2.1 release number 2...
17975 +Wed Aug 19 20:43:09 BST 1998
17977 + * Avoid calling rt_sigaction if the mapped signal number
17978 + is -1. It is not strictly necessary but why bother?
17981 + * Added David Bruce's updated x286emul.
17985 +Mon Aug 17 21:29:53 BST 1998
17987 + * Avoid calling fput with a NULL file pointer.
17991 +Sun Aug 16 17:32:20 BST 1998
17993 + * Fix to copy_{to,from}_user return checking. In many
17994 + cases we do not care because they are behind verify_area
17995 + checks but in some we do - and copy_{to,from}_user
17996 + returns the number of bytes _uncopied_.
18000 +Sat Aug 15 23:39:42 BST 1998
18002 + * Change the flock handling to bounce the flock struct
18003 + through kernel space rather than using an in place
18004 + modification. The assumptions we were making about
18005 + segment registers seem to have become invalid at some
18006 + point. We could go to put_user(get_user()) but moving
18007 + the whole struct is probably more robust. Which is
18008 + faster? I dunno...
18012 +Sat Aug 15 22:30:41 BST 1998
18014 + * Changes to signal functions. Previous code confused old and
18015 + new sigsets and could have lead to memory corruption and
18016 + was likely the cause of signals getting blocked unexpectedly.
18017 + Now we use the rt_sig* and new sigset interface to the
18018 + kernel exclusively (in a few years the old stuff may be
18019 + removed). This does means that a non-Linux program may
18020 + now operate on signals >32 which may not have existed
18021 + (and therefore would have errored) in the native environment.
18022 + This may be considered a bug or a feature as appropriate...
18026 +Mon Jul 20 22:23:14 BST 1998
18028 + * ALPHA 2.1 release...
18032 +Mon Jul 20 20:55:47 BST 1998
18034 + * Added support for I_FDINSERT in the STREAMS/TLI message
18035 + protocol handling. This allows TLI server code to work
18036 + using a _real_ libnsl_s (tested briefly) but will break
18037 + server code using my replacement libnsl_s until I update
18038 + it. (It should probably use an I_FDINSERT simply so it
18039 + can still run under SYSV if ever necessary.)
18042 + * Use TIOCINQ instead of FIONREAD in the STREAMS ioctl handler.
18043 + FIONREAD isn't actually supported on sockets. The socksys
18044 + code already had this right.
18047 + * Do the MOD_INC, MOD_DEC calls for sockets in the inherit
18048 + and release handling only to reduce the opportunity for,
18049 + ah, "oversights".
18053 +Thu Jul 16 22:11:48 BST 1998
18055 + * Finally got round to adding a GNU CopyLeft!
18058 + * Set up an XTI/TLI private state struct on all sockets at
18059 + the same time we plug our own file operations in. This
18060 + costs a small amount of extra memory per socket. However
18061 + this is strictly correct (although unlikely to be actually
18062 + _required_ by anything). It also allows us to set up TEPs
18063 + created by XTI/TLI listen/accept easily so they have a
18064 + chance of working.
18068 + Do not auto-listen in getmsg() - listen() after connect()
18069 + appears to crash some 2.1 kernels(?).
18070 + Change the probe for activity in getmsg() to use the
18071 + new poll handler directly.
18072 + Handle listening TEPs slightly better.
18075 + * Changed a stray KERN_ERR to KERN_DEBUG in ioctl.c
18079 +Fri Jul 3 23:20:37 BST 1998
18081 + * Fixed the initial set up of the argument and environment
18082 + lists which were broken during the change to 2.1 style
18083 + user memory access.
18087 +Mon Jun 29 22:50:11 BST 1998
18089 + * Put kernel_version definition back in emulate.c
18092 + * Change loaders to set start_text, end_text, start_data,
18093 + end_data, start_brk, brk fully.
18097 +Thu Jun 25 21:18:11 BST 1998
18099 + * Added support for the "fat" IPC structures which use
18100 + 32 bit uids, gids etc.
18104 +Wed Jun 24 21:30:09 BST 1998
18106 + * Change suser() checks to use the new capable() calls.
18109 + * Changed the CONFIG default to NOT support Xenix 286. It
18110 + is an ever increasing build problem. It needs a volunteer
18114 + * Add locking around system_utsname data using the uts_sem.
18117 + * Changed to use dentry stuff. Use fget()/fput() to get
18118 + file pointers rather than accessing task fd tables
18119 + directly. Use poll interface for SYSV poll and timod
18120 + blocking checks. Use lock_kernel()/unlock_kernel()
18121 + around stat routines and other namei stuff. Use dput()
18122 + to release dentries obtained with namei(). Other
18123 + incidental fixes to what went before as I noticed them.
18127 +Tue Jun 9 20:02:56 BST 1998
18129 + * More changes for new module conventions.
18132 + * Changed signal stuff to new conventions.
18135 + * Changed getname() calling convention.
18138 + * Changed fs type to mm_segment_t.
18141 + * Changed user VM accesses to use new conventions.
18145 +Sat Jun 6 20:30:00 BST 1998
18147 + * Changed to new module conventions.
18151 +Thu May 28 22:30:45 BST 1998
18153 + * Removed VM_STACK_FLAGS tests.
18156 + * Remove VM_GROWSDOWN tests.
18159 + * Removed MAP_EXECUTABLE tests.
18162 + * Removed MAP_DENYWRITE tests.
18165 + * Removed STACK_TOP tests.
18168 + * Removed FORKNOEXEC tests.
18171 + * Removed INIT_MM tests.
18175 +Mon May 18 22:49:56 BST 1998
18177 + * Fixed xnx_rdchk() return value.
18180 + * The serial number returned in the SCO utsname struct
18181 + can now be set with sco_serial="..." as a module
18182 + option. Some program apparently want to find a real,
18183 + believable serial number there. This should be documented
18184 + somewhere other than here I guess...
18188 +Mon May 18 22:03:49 BST 1998
18190 + * A class 't' ioctl with no arg type stuff in the top
18191 + word is either an SVR4 tape ioctl a Coherent BSD-ish
18196 +Mon Feb 2 22:57:45 GMT 1998
18198 + * Other relatively minor changes to allow compilation
18199 + under glibc (specifically 2.0.6 but it shouldn't
18203 + * Added an explicit -I flag to search /usr/src/linux/include
18204 + since glibc doesn't necessarily require the kernel
18205 + includes to be symlinked under /usr/include.
18208 + * The personality defaults in binfmt_coff should probably
18209 + select short inodes on the assumption that newer stuff
18210 + is likely to be built as ELF anyway. I hope.
18214 +Wed Nov 19 19:28:07 GMT/BST 1997
18216 + * Attempt to work around problems with sign extension
18217 + when programs believe that the fs magic in a sysfs()
18218 + call is short rather than long.
18221 + * Added IPPROTO_IP/SOL_IP option name mapping for
18222 + {get,set}sockopt. This is correct for SCO OS5 and
18223 + hopefully for other SYSV derived Unices. Note that
18224 + SCO OS5 ping still doesn't work because it uses an
18225 + unsigned char for the IP_TTL value whereas Linux
18226 + wants an int - and it objects to getting an error
18227 + return. Apparently POSIX 1003g says IP_TTL should
18228 + be an unsigned char so OS5, or at least its ping,
18229 + is at fault. This probably isn't worth hacking
18230 + around unless someone _really_ needs it.
18234 +Wed Nov 12 22:28:19 GMT/BST 1997
18236 + * Added the SCO-ish syscall shortcut to the socksys
18241 +Fri Nov 7 20:13:05 GMT/BST 1997
18243 + * Oops, I installed the SCO signal tables in the old
18244 + personality mapping but forgot to create a specific
18245 + SCO personality using them.
18249 +Thu Nov 6 08:04:37 GMT/BST 1997
18251 + * No, it really should be USR1 for URG under SCO, not
18252 + USR2. This is according to the SCO Network Programmer's
18253 + documentation. The previous problem was because
18254 + confusion between the SVR4 and SCO/SVR3 requirements
18255 + prevented a SCO program from registering a handler
18256 + for the right signal, I think.
18260 +Wed Nov 5 14:23:22 GMT/BST 1997
18262 + * Created a new signal mapping for SCO and mapped
18263 + Linux SIGURG to SCO SIGUSR2. Also changed the
18264 + plain ibcs mapping for SIGURG back to IBCS_SIGURG.
18265 + Previously I had SIGURG mapped to SIGUSR1 for
18266 + what my subconscious says was a good reason but
18267 + I can't figure out where I got it from. The USR2
18268 + mapping is according to Peter Brueckner - and if
18269 + it works for him...
18273 +Wed Nov 5 09:14:27 GMT/BST 1997
18275 + * Repair the STREAMS based socket code. The new socket
18276 + hashing in 2.0.30 and beyond means the old code no
18277 + longer works. We now delay replacing the fd with
18278 + a socket until the first read, write or ioctl. Since
18279 + the open has completed at this stage and the fd is
18280 + fully initialized we can then use dup() to do the
18281 + fd switch, which should always work. As a side effect
18282 + this allows us to auto-connect an SPX pipe to X :0
18283 + if the first operation is other than a single character
18284 + write - which should allow us to handle v. old SVR3
18285 + X programs side by side with their more modern, and
18286 + common, multi-SPX pipe descendants.
18287 + This does mean that some error returns from an
18288 + open of a TLI special file might be delayed until
18289 + the first operation, however a) these are unlikely
18290 + to occur (they are things like no such protocol)
18291 + and b) most opens of such files are hidden in
18292 + functions like t_open() anyway so if there is a
18293 + problem a simple fix to libnsl to check the first
18294 + ioctl is all that is needed.
18297 + * sysfs() used to enumerate available filesystems seems
18298 + to be 0 based on Linux but 1 based on SYSV.
18302 +Sun Oct 12 00:18:33 GMT/BST 1997
18303 + * Ioctls on the NFS pseudo device need to go via the
18304 + emulation code rather than the native ioctl handler.
18308 +Sat Aug 16 14:56:24 GMT/BST 1997
18310 + * Changed the use of errno in a prototype in ibcs.h to
18311 + avoid possible conflict with an SMP errno definition
18312 + which could get inherited from an include file if we
18317 +Sat Jul 12 01:00:00 GMT/BST 1997
18319 + * Added Xenix locking() modes 5, 6, 7 as per patch from
18320 + David Bruce <admin@hulcote.com> (there were others
18321 + too). I rewrote it to be a bit cleaner but I haven't
18322 + tested it (it's late...). Some one will tell me I guess.
18325 +Fri Jul 11 22:27:13 GMT/BST 1997
18327 + * Added more console ioctl traps to discourage programs
18328 + from trying to do funky stuff with the console without
18329 + logging unsupported ioctl messages.
18332 + * sysfs() can, apparently, map an fs magic number to
18333 + an fs name. We do this outside the kernel sysfs()
18334 + because there seems no clean way to do it. We simply
18335 + have a list of known magic numbers hard coded :-(.
18338 + * Implemented sysconfig(). This is appears to be the SVR4
18339 + forerunner to the POSIX sysconf().
18343 +Tue May 13 20:52:05 GMT/BST 1997
18345 + * Hand off xmknod calls via ibcs_mknod so that we can
18346 + create a directory if that is what the flags imply.
18347 + I have not tested to see if xmknod is allowed to create
18348 + directories - I just noticed it in passing.
18351 + * Added SCO's F_GETHFDO (get highest fd open) fcntl. This is
18352 + used by /bin/csh on SCO OS5 to save a few syscalls.
18356 +Tue May 13 00:10:09 GMT/BST 1997
18358 + * More changes to handle long/short inode environments
18359 + plus more explanation in the code. Are we having fun yet?
18363 +Sat May 10 15:19:39 GMT/BST 1997
18365 + * Added socketpair() to the socksys emulation. This is
18366 + as implemented by SCO OpenServer 5.
18369 + * Change binfmt_coff.c to recognise programs compiled for
18370 + SCO OpenServer 5, programs compiled for SCO 3.2.4 and
18371 + programs compiled under SCO OpenServer 5 but with
18372 + compatibility for ODT3.0. Why? Well, sometimes we
18373 + should be giving long inodes in returns from getdents,
18374 + sometimes short inodes. We don't just want to mask
18375 + off the high part because that can lead to some
18376 + things becoming invisible. We don't want that.
18380 +Fri May 9 23:29:37 GMT/BST 1997
18382 + * Added some more tape ioctls.
18386 +Wed Apr 16 23:12:37 GMT/BST 1997
18388 + * Fix memory leaks in poll.c and change ENOMEM return
18393 +Tue Mar 11 21:29:15 GMT/BST 1997
18395 + * Add {get,set}rlimit to the SYSV personalities.
18399 +Fri Mar 7 21:04:24 GMT/BST 1997
18401 + * Only build x286emul if EMU_X286 is enabled in CONFIG. There
18402 + are many insallations which appear to either not have the
18403 + a.out compiler support or have it installed incorrectly.
18407 +Tue Feb 18 22:04:39 GMT/BST 1997
18409 + * Removed unnecessary and incorrect includes.
18413 +Wed Feb 12 22:03:13 GMT/BST 1997
18415 + * Documentation updates for release.
18419 +Mon Feb 10 22:36:27 GMT/BST 1997
18421 + * Dammit! The inode folding in stat() and getdents() was
18422 + out of step _again_ :-(.
18426 +Sun Jan 5 17:20:20 GMT/BST 1997
18428 + * sysconf(_SC_CLK_TCK) should return the value of HZ.
18431 + * Small clarification to README concerning shared libraries.
18434 + * Removed the bit about UnixWare X binaries not working from
18435 + Doc/HINTS. Now we have STREAMS/TLI emulation this is no
18436 + longer true (and hasn't been for a while).
18440 +Sat Jan 4 19:31:26 GMT/BST 1997
18442 + * If we open() something that is really a socket we close
18443 + it and reopen it using socket(), connect(). This allows
18444 + a Unix domain socket to look like a named pipe which
18445 + enables more SYSV X clients to connect to a local X
18446 + server using the local method (with suitable symlinks
18447 + to map the pathnames).
18451 +Fri Jan 3 22:39:15 GMT/BST 1997
18453 + * Added a (simplistic) implementation of the I_CANPUT SVR4
18457 + * Changed CONFIG.i386 to note that a correct setting of SMP
18458 + is now necessary.
18462 +Wed Oct 2 16:28:39 GMT/BST 1996
18464 + * Intercept mknod() and allow it to create directories. Linux
18465 + doesn't allow this but SYSV does. (What about BSD?)
18469 +Wed Oct 2 15:56:57 GMT/BST 1996
18471 + * Separated out the spx connect code so we can support old,
18472 + single connection spx implementations once we know how to
18476 +Wed Oct 2 15:54:45 GMT/BST 1996
18478 + * At some stage I add some binfmt_elf.c changes that were
18479 + made to the kernel ELF loader in some 2.0.x patch. I forget
18480 + which now but no one should be using the iBCS ELF loader
18481 + currently anyway.
18485 +Fri Aug 23 15:42:04 GMT/BST 1996
18487 + * Moved svr4sig to the right place.
18490 + * Moved error message strings to a separate file so they can
18491 + be shared by emulate.c and solaris.c.
18494 + * CONFIG files now define ARCH to be the CPU architecture. This
18495 + is used to ensure that architecture specific files are only
18496 + used when necessary.
18499 + * Changed the getdents routine in open.c to use the same
18500 + rules for folding 32 bit inodes to 16 as stat and read.
18504 +Mon Aug 19 13:33:42 GMT/BST 1996
18506 + * Correct IPC problem introduced with Sparc changes.
18510 +Fri Aug 9 13:27:49 GMT/BST 1996
18512 + * Fix the inode swapping for /dev/spx and XTI/TLI transports.
18515 + * If a COFF binary doesn't have a .comment section we have no
18516 + way to tell what personality we should be using. Switch to
18517 + SCO anyway - odds on it is.
18521 +Wed Aug 7 14:22:11 GMT/BST 1996
18523 + * On SCO at least lseek on a character or block device
18524 + returns 0 not -ESPIPE.
18525 + -- C.A. Lademann <cal@zls.com>
18527 + * Some problems with /dev/spx and TLI end point handling that
18528 + could leak descriptors, memory and leave the lists of file
18529 + locks in an inconsistent state. Not to mention the fact that
18530 + the socket data in an inode also contains a pointer back to
18531 + the process' file structure. I _think_ I have this sorted
18535 + * Sparc changes broke select. While I was at it I changed it
18536 + to use the newselect Linux call as well. If we build without
18537 + tracing we'll save a few more bytes of code now too.
18541 +Wed Jul 31 14:16:38 GMT/BST 1996
18543 + * Map EAGAIN to EWOULDBLOCK for recv*() and send*() syscalls.
18544 + Linux seems to return EAGAIN. X/Open allows either EAGAIN
18545 + or EWOULDBLOCK. SVR4 and Wyse V/386 specify EWOULDBLOCK in
18546 + their man pages. SCO doesn't admit to non-blocking possibilities
18547 + in their man pages but some code seems to expect only
18552 +Mon Jul 29 16:58:11 GMT/BST 1996
18554 + * Added a CONFIG option for SMP. This is enabled by default.
18555 + I don't think this is a problem for non-SMP systems?
18558 + * Minor change to the SCO error map.
18562 +Fri Jul 26 09:13:43 GMT/BST 1996
18564 + * Updated README and RELEASE
18567 + * Merged Sparc patches from:
18568 + Miguel de Icaza <miguel@roxanne.nuclecu.unam.mx>
18572 +Thu Jul 4 12:24:06 GMT/BST 1996
18574 + * The default is now *not* to build a versioned module. I got
18575 + too many questions about why it wouldn't compile.
18578 + * Fix to binfmt_xout.c when Xenix 286 is emulation is not
18583 +Fri Jun 14 13:36:18 GMT/BST 1996
18585 + * Added code to explicitly fail the SCO LD?MAP ioctls used
18586 + for channel mapping.
18590 +Thu Jun 6 17:21:00 GMT/BST 1996
18592 + * Cleaned up Stephans SCO tape ioctls and added the
18593 + corresponding SVR4 versions (untested).
18597 +Wed Jun 5 10:47:24 GMT/BST 1996
18599 + * Rewritten the Xenix locking() syscall. The previous one
18603 + * Change the read on directory emulation to fold long inodes
18604 + to shorts in the same way as stat and getdents. This may
18605 + help old programs that use stat and read to do a getcwd
18606 + rather than a stat and getdents.
18609 + * Use __get_free_page instead of get_free_page in getdents
18610 + since we don't need the buffer cleared initially (I think).
18614 +Sat Jun 1 09:50:30 MET DST 1996
18615 + * Added some tape ioctrls for SCO to iBCSemul/ioctl.c.
18619 +Fri May 31 08:44:51 GMT/BST 1996
18621 + * Move bsdioctl.c to the main group of source files from
18622 + than the BSD specifics. Just about everything else has
18623 + BSD style sgtty stuff and some seemingly modern code
18624 + actually depends on it (e.g. ISC SVR4 telnet)!
18627 + * Add CONFIG option to build a versioned module.
18630 + * Install the modules in /lib/modules/`uname -r`/misc for
18631 + compatibility with the modules tools.
18634 + * If the requested connection indications in a bind request
18635 + is greater than zero do a listen() if the bind is successful.
18636 + We still also do a listen() if the program selects() on
18637 + a bound but unconnected stream. This may help some broken
18638 + programs. It may also break some broken programs. It's
18639 + debatable whether this should now be in or out.
18642 + * The bit vector mapping used for converting vectors of
18643 + signal flags had an off by one error. The signal maps
18644 + themselves were also one entry short.
18647 + * At some stage I changed the I_SETOWN STREAMS ioctl but
18648 + never committed it?
18652 +Thu May 9 12:51:10 GMT/BST 1996
18654 + * Change to install in /lib/modules/`uname -r`/misc instead
18655 + of /usr/lib/modules for compatibility with the way the
18656 + modules tools have gone.
18660 +Thu Apr 25 12:34:06 GMT/BST 1996
18662 + * Use the CONIND_number in a T_BIND_REQ to decide whether
18663 + or not we should listen() on the socket.
18667 +Mon Apr 22 15:42:47 GMT/BST 1996
18669 + * Added a simple loader that will attempt to pass scripts
18670 + that start with ":" and things that look like simple text
18671 + to /bin/sh. Hopefully this isn't going to conflict with
18672 + magic for other needed formats...
18676 +Fri Mar 29 17:11:35 GMT/BST 1996
18678 + * Committing the all new TLI/XTI options handling. Note that
18679 + TLI and XTI option handling is mutually exclusive at the
18680 + moment. The default is to enable TLI options handling since
18681 + that is what existing SVR3/4 systems use. I haven't found
18682 + one that actually handles X/Open format (they use the
18683 + TNOTSUPPORT cop out) so I don't know how the stack is
18684 + told to use XTI format instead of TLI.
18685 + Note that only SOL_SOCKET/* and SOL_TCP/TCP_NDELAY are
18686 + known to work to any extent at the moment. Others may (or
18687 + may not need mapping) but I can't find the motivation to
18688 + wade through the headers and create yet another table of
18689 + magic numbers. Hopefully everyone just nicked the BSD
18690 + reference code...
18693 + * Some more 1.3.7x changes related to process accounting
18694 + (fork but no exec etc.).
18698 +Wed Mar 20 13:36:07 GMT/BST 1996
18700 + * I seem to have forgotten to add a comment about merging
18701 + changes from mid 1.3.7x kernels.
18705 +Wed Feb 28 14:53:00 GMT/BST 1996
18707 + * Fix to shared library loader in binfmt_aout.c from kernel
18712 +Wed Jan 24 09:58:34 GMT/BST 1996
18714 + * Implemented I_PEEK.
18717 + * Changed I_NREAD to understand that control messages constitute
18722 +Fri Jan 19 11:57:20 GMT/BST 1996
18724 + * Make the socket level connect in timod.c happen synchronously
18725 + always. Allowing the async possibility is a little harder.
18729 +Thu Jan 18 16:06:13 GMT/BST 1996
18731 + * Added (some of) the intial framework for option management.
18732 + This is documented by X/Open but many XTI stacks don't
18733 + seem to implement it. Certainly the man page for t_optmgmt
18734 + in SCO OS5 says it isn't yet implemented. There do seem
18735 + to be programs out there that make options requests though.
18736 + Unfortunately I don't have one right now so this is currently
18737 + disabled and MAY CAUSE KERNEL FAULTS. I don't know...
18741 +Tue Jan 16 12:35:21 GMT/BST 1996
18743 + * Added a slight change to mmap.c. The SVR4 headers describe
18744 + a slight change in functionality which is specified with
18745 + a special flag that is supposedly set by the C library
18746 + interface. I haven't actually seen this flag set by the
18747 + SVR4 dynamic loader (which is the only mmapper I've seen)
18748 + and things seem to work with or without this change. It
18749 + may not be necessary at all?
18753 +Fri Jan 12 14:56:38 GMT/BST 1996
18755 + * Remove trace flag from context() in the callmaps. SVR4's
18756 + /bin/sh seems to use it but doesn't care if it fails.
18759 + * Added the SCO OS5 SI86GETFEATURES request to sysi86(). OS5
18760 + uses this to establish what "features" are available when
18761 + a program starts (i.e. in crt*.o). Currently we just return
18762 + the same vector as OS5 itself. I haven't found what the
18763 + flags mean - but one of them indicates xstat extensions
18764 + which I have added to iBCS.
18767 + * Change .comment parsers in binfmt_coff.c and binfmt_elf.c
18768 + so we only grab a single page (asking for two contiguous
18769 + pages is antisocial) and then roll through the comment
18770 + section in stages.
18773 + * Fixes to binfmt_elf.c and binfmt_aout.c so they compile
18774 + and load with 1.3 kernels.
18778 +Tue Jan 9 14:29:49 GMT/BST 1996
18780 + * Add a kludge to the TLI connect code. For some reason, under
18781 + ISC SVR4, telnet seems to gve the port number in network
18782 + byte order ok but the X programs give it in host byte order.
18783 + One of them is wrong but presumably both work on ISC (I don't
18784 + have the hardware to actually install it). We kludge around
18785 + it here by checking if we are SVR4, AF_INET, port 6000 (host
18786 + order) and, if so, change it to port 6000 (network order).
18787 + This will break anything that wants to make an outgoing
18788 + call to port 28695. There are probably other things that
18789 + expect incorrect port numbers to work but there seems to
18790 + be no easy solution here.
18794 +Fri Jan 5 13:34:43 GMT/BST 1996
18796 + * First draft of code to handle select/poll on transport end
18797 + points correctly. This isn't well tested but should be good
18798 + enough to support normal timod usage.
18802 +Thu Jan 4 13:52:25 GMT/BST 1996
18804 + * TLI changes to get error returns from connects correctly.
18808 +Wed Jan 3 17:06:07 GMT/BST 1996
18810 + * Added a manual page in the Doc directory. This is not
18811 + installed by default.
18814 + * Fixed a problem in the .comment parsers in binfmt_elf.c
18815 + and binfmt_coff.c where a number of pages was passed to
18816 + __get_free_pages() instead of a binary power. This has
18817 + been in release versions of binfmt_coff.c for a long
18818 + time but exactly one person has reported anything that
18819 + might be attributable to it. Strange, since the bug should
18820 + have manifested itself as insidious memory leakage and
18825 +Wed Jan 3 12:16:47 GMT/BST 1996
18827 + * Removed all kernel patches in the Patches directory. None
18828 + should be need for kernels 1.3.50 (or earlier?) and onwards.
18829 + None should be essential for 1.2.13 - although some capability
18830 + is lost notably SCO OpenServer 5 ELF binaries (if the kernel
18831 + ELF loader is present) and BSD a.out binaries.
18834 + * Another fix to termio[s] ioctls to get the control character
18835 + settings right for SVR4. Previously this was just copied
18836 + from the SCO mapping and just never got changed.
18840 +Thu Dec 14 10:41:36 GMT 1995
18842 + * Added basic getpmsg/putpmsg support. It doesn't do anything
18843 + with bands but we don't have anyway to use them.
18847 +Tue Dec 12 09:38:01 GMT 1995
18849 + * First commit of the major TLI rewrite for Eric Sixt. This
18850 + should be enough for normal TCP & UDP clients. It may be
18851 + sufficient for servers as well but this is untested so far.
18852 + The client stuff has been tested with SCO cu, ISC telnet
18853 + and custom test code down to the getmsg/putmsg level. A shared
18854 + libnsl_s is also included. This has the functions needed for
18855 + clients but lacks some needed for servers currently. It has
18856 + been tested on a real SCO system. It could be done better
18857 + (and should be) but for now we are interested in making existing
18858 + programs work rather than handling all the error conditions
18859 + by the book. The library uses SVR3 shared library tools and
18860 + needs to be built on an SVR3 system (I used SCO).
18861 + Included is a rewrite of the /dev/spx kludging (the old didn't
18862 + work if TLI was enabled). This now allows connections to other
18863 + than /tmp/.X11-unix/X0 (if configured) so you can run multiple
18864 + X servers on the VCs and display SCO X programs on all of them.
18865 + The major/minor numbers used for the emulation devices have
18866 + (necessarily) changed. The top level Makefile will (re)create
18867 + them on a "make install" or "make devices".
18868 + Oh yeah, I built stubs for other libraries as well (specifically
18869 + SCO/SecureWare protlib_s) but don't expect it to have any real
18870 + support. If programs _really_ need stuff from there they are
18871 + like to have reduced or completely broken functionality on
18873 + The script I used to generate the skeleton APIs for the
18874 + shared libraries is libs/mkltab if anyone feels the urge to
18875 + look at other libraries...
18878 + * Removed the old quota compile option. It isn't compatible with
18879 + the quota stuff in 1.3.46 and would only cause confusion. This
18880 + means you can't use iBCS if you have the old quota patches
18881 + in a pre-1.3.46 kernel. Tough :-).
18885 +Mon Dec 11 15:14:46 GMT 1995
18887 + * Map I_SETSIG/I_GETSIG to FIOSETOWN/FIOGETOWN and pray...
18890 + * Fixed possible memory leak in COFF & ELF personality recognition
18891 + when the offset/size of the .comments section is invalid. This
18892 + could leak when the .comments section exists but is zero bytes
18897 +Wed Dec 6 11:31:27 GMT 1995
18899 + * A stat of a file must give an inode that matches what we get
18900 + from a read of the directory since code that figures out cwd
18901 + needs the inodes to match. Mind you, if there are several inode
18902 + numbers greater than 65534 in the directory we are going to get
18903 + some strange paths. I don't know if this is fixable properly at
18907 + * Yes it is. We just mask off the high word to get the short
18908 + inode number for the stat structure.
18912 +Thu Nov 30 16:21:32 GMT 1995
18914 + * Fix the SVR4 additions to the V7 terminal ioctls. Add handling
18915 + of TIOC[GS]ETD. Have TIOCL[GS]ET trivially succeed (I can't
18916 + find the documentation for the arguments).
18920 +Wed Nov 29 12:57:42 GMT 1995
18922 + * Changed the guesswork svr4_waitsys to implement the correct
18926 + * Enable the i486-linuxaout option in x286emul/Makefile by
18927 + default. There seem to be significant numbers of people
18928 + using ELF compilers now. This may be a mistake...
18931 + * Fixes to sigsuspend and sigpause in signal.c. The previous
18932 + invocations of the Linux sigsuspend syscall were wrong and
18933 + liable to lead to random freeze ups of programs which used
18934 + sigsuspend() or sigpause().
18938 +Fri Nov 24 11:03:01 GMT 1995
18940 + * Interactive SVR4 seems to be overloading the BSD termio
18941 + ioctls with its own.
18944 + * The SVR4 procid subcodes don't match the SCO ones. Or, at
18945 + least, I seem to remember I got the orignal set from SCO
18946 + and UnixWare and Interactive SVR4 are different (but match
18951 +Thu Nov 23 17:21:56 GMT 1995
18953 + * Interactive SVR4's /bin/sh calls access(..., 011) but Linux
18954 + returns EINVAL if the access mode has any other bits than
18955 + 007 set. So we have to wrap it and mask it :-(.
18959 +Wed Nov 22 10:11:49 GMT 1995
18961 + * Change to binfmt_elf.c to set total_vm value introduced in
18966 +Thu Nov 16 15:02:58 GMT 1995
18968 + * Added support for SCO OpenServer 5 binaries using .comment
18969 + section parsing as with COFF.
18970 + Built a BSD capable a.out loader as part of iBCS.
18971 + The iBCS ELF loader is only used for recognised (using
18972 + .comments) binaries if the standard ELF loader is configured
18973 + in the kernel iBCS is built against. If the ELF loader is
18974 + not configured in the kernel iBCS is built against the iBCS
18975 + ELF loader is used for all ELF binaries. This prevents the
18976 + iBCS module from becoming un-unloadable on ELF based Linux
18978 + Similarly the iBCS a.out loader tries to avoid dealing
18979 + with anything other than BSD binaries for the same reasons.
18980 + This requires a kernel 1.3.42 or greater to allow iBCS
18981 + to insert its loaders into the list before the standard
18982 + kernel ones. Kernels 1.3.39(~) to 1.3.41 have some support
18983 + but there are bugs which will likely prevent you running
18984 + *anything* as soon as iBCS is loaded. Mea culpa. Tough.
18988 +Thu Nov 16 11:00:08 GMT 1995
18990 + * Minor clean up in binfmt_coff.c and fix a minor bug in
18991 + parse_comments that caused it to miss checking a string
18992 + if there was a zero length string in among.
18996 +Fri Nov 10 12:22:05 GMT 1995
18998 + * Changes for latest module bogosities (~1.3.38). We need to
18999 + define __NO_VERSION__ to avoid linux/module.h putting
19000 + a kernel_version in *every* damn file.
19004 +Tue Nov 7 10:55:05 GMT 1995
19006 + * When stealing temp space from the stack we have to actually
19007 + move esp down and then restore it as the 1.3.x kernels add
19008 + a check to trap out of bounds stack accesses. This is not
19009 + tested but I think it only affects the TLI emulation code
19010 + which is disabled by default.
19014 +Mon Oct 9 11:22:29 BST 1995
19016 + * Use kernel readv/writev if available.
19020 +Thu Sep 14 12:21:48 BST 1995
19022 + * Changed references to current->sigaction to allow for the
19023 + changes in kernel patch 1.3.26 which allow sharing of signal
19024 + state between clone processes.
19028 +Mon Sep 4 10:04:22 BST 1995
19029 + Originally: Wed Aug 2 09:57:56 GMT 1995
19031 + * Removed Xenix interrupt bug, created wait() workaround
19032 + for INFORMIX-SQL and built the locking() to fcntl()
19034 + -- Peter <polte@bbtt.com>
19037 +Wed Aug 30 09:19:54 BST 1995
19039 + * Merged kernel patch for binfmt_elf.c from 1.3.21 which sets
19040 + EDX to zero on process start up. See the comment in the code
19045 +Tue Aug 29 08:44:50 BST 1995
19047 + * Workaround. Local X won't work because a putmsg occurs
19048 + after we have already swapped the open descriptor for a
19049 + Unix domain socket. We either need to peek at socket
19050 + internals or actually implement the messages for passing
19051 + file descriptors. This quick fix enables local X connections
19052 + if we build without XTI support.
19056 +Tue Aug 8 11:36:41 BST 1995
19058 + * Fix streams kludging so local X works again (should do
19059 + anyway - it's untested as yet due to hard disk collapse.
19060 + Hopefully someone will tell me if it doesn't work.)
19064 +Mon Jul 31 13:25:58 BST 1995
19066 + * Changes to allow compilation in the presence of a kernel
19067 + built with the quota patches.
19068 + -- Dimitrios Mpougoulias <dbougo@leon.nrcps.ariadne-t.gr>
19071 +Tue Jul 18 09:01:53 BST 1995
19073 + * Fixed timod getinfo ioctl. This functionality should move
19074 + into the message handling as bind has.
19078 +Mon Jul 17 10:16:43 BST 1995
19080 + * Added handling of BSD-ish sgtty ioctls. For some reason the
19081 + SVR4 network programs such as telnet have been modified to
19082 + pushd the ttold STREAMS modules and use sgtty calls instead
19083 + of simply using termio[s]. Don't blame me! :-)
19086 + * Restructuring of timod.c complete. Timod ioctls now use
19087 + message routines to avoid duplicating code.
19091 +Wed Jul 12 14:44:30 BST 1995
19093 + * Made debug output in binfmt_coff.c less verbose. We only
19094 + really care about matched comment strings. If we dump them
19095 + all here we overrun the kernel message buffer and miss
19096 + interesting stuff when the program actually starts running.
19099 + * Changed __get_free_pages in binfmt_coff.c to give the extra
19100 + argument required in 1.3 kernels.
19104 +Tue Jul 4 11:48:27 BST 1995
19106 + * Restructure timod.c ready to rewrite timod_ioctl to use
19107 + putmsg/getmsg rather than reimplementing the same message
19112 +Mon Jul 3 13:41:49 BST 1995
19114 + * Initial TLI support for outgoing TCP and UDP. Merged BSD/Wyse
19115 + socket ioctl handling with the socksys handler. Fixed (some)
19116 + bugs in poll() emulation. Devices in /dev/inet have changed
19117 + to support TLI access. See README for details.
19121 +Tue Jun 27 09:00:02 BST 1995
19123 + * Don't export symbols from iBCS. I'm not sure when register_symtab
19124 + was introduced so we only drop our symbol table in 1.3
19128 + * Added missing brackets in binfmt_elf.c as per kernel
19133 +Thu Jun 22 13:09:49 BST 1995
19135 + * Big step forward with TLI. I now seem to understand what is
19136 + happening when and have enough to do the initial open and
19137 + get info requests. This may one day actually work...
19140 + * Trap EUC ioctls and return EINVAL. We don't do EUC :-).
19143 + * Changes for the 1.3 development kernel. This compiles but is
19144 + as yet untested. It still seems ok with 1.2.10.
19148 +Wed Jun 14 09:15:39 BST 1995
19150 + * Added Eric's protection mapping fixes to binfmt_elf.c
19155 +Fri Jun 9 12:31:53 BST 1995
19157 + * Linux can't stat unmounted filesystems but SCO can (by
19158 + specifying the pathname/fd of a block device and the
19159 + filesystem type. Linux will just stat the filesystem
19160 + that the device node is on (i.e. the root filesystem).
19161 + There isn't much we can do about it. I just lie and
19162 + claim there is 100MB free of 1GB. I hope this won't
19163 + cause too much grief...
19167 +Thu May 18 12:06:50 BST 1995
19169 + * When trying to get an IP domain name don't try the utsname
19170 + domainname if it is "(none)". If we get that far we have to
19171 + give in and return a blank domain name.
19175 +Wed May 17 10:15:42 BST 1995
19177 + * Recheck the socket functions when accept returns a new socket.
19178 + This is pedantic at this stage since we must have had a
19179 + socket initially and the current kernel code isn't likely
19180 + to handle removal and reloading of in use modules. iBCS
19181 + can handle this happening to it though :-).
19184 + * Fix timod faking to correctly return an error if given an
19185 + invalid file descriptor rather than trying to dereference
19186 + a null pointer in kernel mode.
19190 +Tue Apr 25 11:35:43 BST 1995
19192 + * If nap() is given a zero timeout return immediately rather
19193 + than blocking indefinitely. Ensure that SIGALRM is not ignored
19194 + during the pause or we never get woken up by the timeout.
19198 +Mon Apr 24 09:21:30 BST 1995
19200 + * Various documentation updates from Eric.
19204 +Fri Apr 21 14:34:25 BST 1995
19206 + * Fixes to IPC. Now it really *should* work...
19210 +Thu Apr 13 14:03:45 BST 1995
19212 + * Tidy up documentation ready for new release.
19216 +Wed Apr 12 11:07:52 BST 1995
19218 + * Moved to an ELF development system with a GCC 2.6.4 snapshot.
19219 + This pointed out a few signed/unsigned mismatches so I
19220 + fixed them. We also have to ensure that x286emul is built
19221 + as a QMAGIC a.out because it won't work any other way. It
19222 + isn't likely to work any other way unless someone pays for
19223 + for it to be done - it isn't what you might call a "sexy"
19228 +Wed Apr 12 08:53:22 BST 1995
19230 + * Added the kernel patch to handle statically linked SVR4 ELF
19231 + binaries to the Patches directory since it doesn't seem to
19232 + have made any of the 1.2.x patches yet.
19236 +Tue Mar 28 09:55:38 BST 1995
19238 + * Made the ISC specific stuff optional via CONFIG.
19241 + * 1. INTERACTIVE UNIX signal numbers are different from IBCS2.
19242 + I added new signalmaps and exec_domains.
19243 + 2. setpgrp does not deattach the controlling terminal.
19244 + Try the setpgrp test program included here after the patch
19245 + on real SCO or xxxx and Linux/IBCS2.
19246 + 3. sigset behavior is incorrect. Test program also included.
19247 + Short description: signal handlers registered whith sigset
19248 + should run with the signal blocked, and after return
19249 + the handler must be restored, so sa_flags = 0
19250 + is the correct setting.
19251 + Calling sigset should remove the signal from the
19253 + -- Remete Gabor <rg@tomx.elte.hu>
19256 +Fri Mar 24 10:20:57 GMT 1995
19258 + * Set the fragment size to zero for [f]statfs() just to be
19259 + pedantic (SCO does this).
19263 +Tue Mar 21 10:24:14 GMT 1995
19265 + * Fixes to 286 overlay and x.out loader by Don Camp
19266 + <don@funsoft.com>.
19269 + * New code for SVR4 {get,set}groups since SVR4 uses longs
19270 + for gids whereas Linux uses shorts.
19274 +Mon Mar 20 17:06:23 GMT 1995
19276 + * Added code for waitsys(). This is guesswork at this stage
19277 + but appears sufficient for ISC 4.0 ksh to do something
19278 + reasonable in the simplest case.
19282 +Tue Mar 14 09:44:13 GMT 1995
19284 + * Initial implementation of ptrace. This allows programs
19285 + (SCO and Wyse V/386 programs) to access a process'
19286 + registers but actual tracing semantics will be difficult
19287 + to make functional.
19290 + * Alter emulate return to allow return of numbers > 2^^31
19291 + which don't fall in the error code space.
19294 + * Added signal mapping to wait() syscalls.
19297 + * Updated the main README with the vger mailing list details
19298 + and a few other tidy ups.
19302 +Thu Mar 9 10:10:53 GMT 1995
19304 + * Added a load more system calls to the SVR4 tables (these
19305 + match UnixWare at least I think). Some of these may work,
19306 + some are just marked to shut up run time warnings.
19309 + * Increased the size of the buffer used for parsing comment
19310 + sections in binfmt_coff.c to 8k (from 1k). There are
19311 + programs out there that need it.
19315 +Tue Mar 7 16:12:36 GMT 1995
19317 + * More XLI/TLI changes - mostly fixes.
19320 + * Added basic handling of the termiox extension used by SVR4
19321 + to give access to hardware flow control. Only RTS & CTS
19322 + or nothing is allowed because that's all Linux does. The
19323 + same comments as below apply to the status of this.
19326 + * Rework ioctl handling for termios. SCO uses short in a termios
19327 + structure, SVR4 uses longs. The bit shuffling used for SVR4 is
19328 + the same as for SCO - there are known to be some slight
19329 + differences but these are not believed to be critical for
19330 + most things. A large amount of guesswork went in to this.
19331 + One day I may be able to test it...
19335 +Mon Mar 6 12:31:05 GMT 1995
19337 + * Added a -DMODULE to iBCSemul/Makefile to make new style kernel
19342 +Fri Mar 3 15:04:14 GMT 1995
19344 + * Patches from Eric. (Use Eric's [f]statvfs instead of mine).
19348 +Thu Mar 2 11:46:03 GMT 1995
19350 + * Fixed a silly in the handling of SO_IMASOCKET and SO_PROTOTYPE
19351 + plus added a check on the given buffer length.
19354 + * Fixed a silly in the sockopt.inc options mapping.
19358 +Wed Mar 1 14:20:06 GMT 1995
19360 + * Added SVR4 console keyboard mapping and termcap/terminfo
19361 + options to the PROD.Patches directory.
19365 +Mon Feb 27 13:30:17 GMT 1995
19367 + * Added simpleminded implementation of [f]statvfs().
19370 + * [f]statfs() now respects the length argument to allow for
19371 + older/smartass code which uses a smaller buffer size.
19375 +Fri Feb 17 10:33:23 GMT 1995
19377 + * More tidy up, a little more work on TLI/XTI (still nowhere
19378 + near usable), fixed the signal debugging messages so it
19379 + makes more sense.
19383 +Thu Feb 2 12:45:25 GMT 1995
19385 + * Changed the BSD termio ioctl handler to recognise the fact
19386 + that some provide V7 compatibility and may be invoked from
19387 + non-BSD binaries - possibly without BSD size encoding.
19390 + * Changes for 1.1.88. More definitions moved around in the
19391 + Linux header files :-).
19395 +Fri Jan 27 10:12:51 GMT 1995
19397 + * Also mapped new Linux SIGIO to iBCS SIGIO and changed Linux
19398 + SIGURG to map to SIGUSR1 as documented in SCO's TCP/IP
19399 + programmer's guide. Is SVR4 the same? How badly do we care?
19402 + * Had to add a new personality for Xenix binaries since they
19403 + have a different number for SIGPOLL - sigh...
19407 +Mon Jan 23 15:34:01 GMT 1995
19409 + * Changes to includes for 1.1.84.
19412 + * Change to binfmt_elf.c from kernel patch 1.1.84.
19416 +Tue Jan 17 17:10:25 GMT 1995
19418 + * Added tracing of argument and environment vectors passed
19423 +Mon Jan 16 11:34:58 GMT 1995
19425 + * Change socksys.c for 1.1.81. There doesn't seem to be a
19426 + convenient define to test but I intended to roll out
19427 + most of the "magic" define testing for 1.2 to clean
19431 + * Ensure the segment registers are correctly set up when we
19432 + exec a new program - the LDT we may have been using before
19433 + no longer exists.
19437 +Fri Jan 6 11:32:52 GMT 1995
19439 + * Fixed a problem where the Xenix 286 emultor wasn't getting
19440 + the correct return and error codes from lcall7s.
19443 + * Added support for exec() in the Xenix 286 emulator.
19446 + * Made the spin-before-launch trap in binfmt_xout.c settable
19447 + via a trace option, "xout-block". This is used to attach
19448 + gdb to a 286 process to debug the emulator.
19451 + * Fixed a problem with binfmt_xout.c setting the wrong intial
19452 + brk value for impure segmented binaries. The checks for brk
19453 + collisions with mapped space were failing brk changes. Before
19454 + the brk checks were introduced I image we simply trashed
19459 +Thu Jan 5 11:21:51 GMT 1995
19461 + * Added some debug to the STREAMS I_PUSH and I_POP. Also made
19462 + them succeed without actually doing anything. We may be able
19463 + to work round some instances of STREAMS usage one day...
19467 +Wed Jan 4 11:17:14 GMT 1995
19469 + * Change yesterday's mkdir to use getname()/putname() to
19470 + fetch the pathname from user space. I hadn't realised
19471 + these were already in ksyms.c (although how long have they
19472 + been there? This breaks compatibility with older versions
19473 + of the kernel I guess).
19476 + * Implement the NIOC ioctls for getting file handles since
19477 + Oracle's TCP server seems to be wanting to do this for some
19478 + reason (why???). This is a simple implementation that simply
19479 + fills in the device number of the filesystem and the inode
19480 + number of the file. This seems to agree with what SCO is
19481 + doing. I don't know what the "exported" fields are or should be.
19485 +Tue Jan 3 14:31:13 GMT 1995
19487 + * POSIX says that a pathname ending with a '/' means the current
19488 + directory whereas SYSV drops the trailing slash. This is only
19489 + a problem with mkdir() I think.
19493 +Fri Dec 16 16:25:44 GMT 1994
19495 + * Added basic support for Wyse V/386 MPX syslocal().
19499 +Fri Dec 9 09:14:04 GMT 1994
19501 + * Changed eaccess() again. We should always set the uid/gid
19502 + rather than fsuid/fsgid since the Linux access() call is
19503 + getting fsuid/fsgid from the current uid/gid.
19506 + * Don't bother trying to read x.out segments which have no
19507 + data in the executable.
19511 +Thu Dec 8 11:51:06 GMT 1994
19513 + * Only include <linux/segment.h> if <asm/segment.h> hasn't
19514 + defined KERNEL_DS. The header in the linux subdirectory
19515 + was obsoleted in 1.1.69.
19519 +Fri Dec 2 13:50:03 GMT 1994
19521 + * Force QMAGIC format when building x286emul.
19524 + * Patches for 1.1.69.
19528 +Thu Dec 1 13:50:37 GMT 1994
19530 + * Binfmt_xout.c now checks the trace flag to see if debug messages
19531 + should be produced. Trace now has an "xout" option. Trace is
19532 + now a Linux binary which uses a personality() syscall to enable
19533 + emulation so the iBCS trace syscall becomes accessible.
19536 + * Changed binfmt_xout.c to use 0x1020 as the entry point for
19537 + the x286emul kludge overlay. This is the expected value
19538 + for a QMAGIC binary which is the default with the newest
19539 + compiler. Really I think uselib() should return something
19540 + useful but I haven't decided what.
19543 + * Made the schedule() trap (so gdb can be attached before the
19544 + process starts running) in binfmt_xout.c a CONFIG option
19545 + controlled by the XOUT_TRACE setting.
19548 + * Moved the configuration for the optional items out of Makefile
19553 +Wed Nov 30 17:08:05 GMT 1994
19555 + * Fixed a nasty bug in binfmt_coff.c where an extra page was
19556 + being allocated in the bss causing brk() checks in 1.1.64
19557 + and later to fail _in_certain_circumstances_.
19561 +Wed Nov 30 13:58:46 GMT 1994
19563 + * Added support for unpacking ioctls passed via the STREAMS
19564 + interface and forwarding them to the file descriptor. With
19565 + a slight change to socksys so that devices with minor 2 get
19566 + an anonymous dgram socket immediately they are opened this
19567 + allows many more network programs to work. Thanks to an old
19568 + piece of code from Chip Rosenthal for revealing how it all
19569 + worked - it isn't in the documentation :-).
19573 +Wed Nov 30 11:27:56 GMT 1994
19575 + * Fixed handling of brk and BSD sbrk so error returns are
19576 + handled correctly.
19579 +Mon Nov 28 10:48:25 GMT 1994
19581 + * When doing an IPC_STAT on a semaphore force the semaphore
19582 + number to be zero as the kernel code erroneously checks
19587 +Fri Nov 25 14:26:41 GMT 1994
19589 + * Massive rework of ipc.c. The previous one was buggy as hell.
19590 + This one works with all the demo programs from the Wyse V/386
19591 + IPC documentation. Hopefully someone is going to test it with
19592 + some *real* applications!
19596 +Tue Nov 22 09:11:46 GMT 1994
19598 + * Change the TTYDEVTYPE ioctl to say we on a pseudo terminal
19599 + rather than a console. Anything calling this is likely to
19600 + want to try fancy stuff like mapping the console memory
19601 + and playing with I/O ports if it thinks we are on a console.
19605 +Tue Nov 22 09:07:04 GMT 1994
19607 + * Allow direct usage of 57600 and 115200 serial speeds from
19608 + the BSD domain with kernels 1.1.65 and later.
19609 + The mask-and-merge for iBCS<->Linux termios should be checked
19610 + as we tend to try and preserve unmappable bits where there
19611 + is no other conflict. In 99% of cases we won't see a problem
19616 +Mon Nov 21 10:05:19 GMT 1994
19618 + * Slight change to previous patch. Confusion over which struct
19619 + size we should be using for the verify_area plus we need to
19620 + do a VERIFY_WRITE as we will rewrite the data before returning.
19623 + * Changes to ipc.c for reading structures from user space.
19624 + -- Roberto Bagnara <bagnara@di.unipi.it>
19627 +Thu Nov 17 15:24:23 GMT 1994
19629 + * Some of the unused KD ioctls were removed from Linux 1.1.64
19630 + (or was it 63?). Changed vtkd.c accordingly.
19634 +Fri Nov 11 14:15:09 GMT 1994
19636 + * Moved the x286emul overlay to /usr/lib instead of /lib. There
19637 + is no real need for this to be on the root filesystem.
19641 +Mon Nov 7 13:51:55 GMT 1994
19643 + * Added a version of the BSD exec.c patch for Linux 1.1.62.
19646 + * Extended SCO keyboard mapping for new kbd.
19650 +Tue Nov 1 10:57:18 GMT 1994
19652 + * Changed the personality test in the BSD kernel patch. Apparently
19653 + FreeBSD uses a machtype of 134 so it's safer to test for Linux
19658 +Fri Oct 28 11:25:43 GMT 1994
19660 + * General clean up of the configuration options in the Makefile
19661 + and elsewhere. It is now possible to choose which loaders are
19662 + included and whether or not BSD or Xenix 286 emulation is
19666 + * Added the x286emul overlay library. This is still very alpha
19667 + but SCO's /bin/masm seems to do the things expected of it :-).
19671 +Wed Oct 5 17:00:13 BST 1994
19673 + * Fleshed out the F_CHSIZE and F_RDCHK fcntls. I still don't
19674 + know if these are ever used from the user layer.
19678 +Tue Oct 4 13:17:32 BST 1994
19680 + * Fixed the BSD termios mappings. This _looks_ ok from the
19681 + point of view of the NetBSD stty.
19685 +Fri Sep 23 11:08:31 BST 1994
19687 + * Add SCO ODT version of CorelDraw to COMPAT file.
19691 +Thu Sep 22 09:25:04 BST 1994
19693 + * Added the phone numbers of McGraw Hill's order desk to the
19697 + * chsize() was causing a segment error. The callmap entry punted
19698 + to a Linux system call but the argument count was not negative
19699 + resulting in a call to a bad function pointer.
19702 + * Linux doesn't have the l_sysid field in struct flock so we need
19703 + to slide the l_pid field down a word after doing a locking
19708 +Tue Sep 20 10:31:01 BST 1994
19710 + * Added a simplistic implementation of writev since BSD seems
19711 + so keen to use it as much as possible.
19714 + * Fixed the x.out loader (mostly). This requires a minor patch
19715 + to the kernel. Expect this to be put in to the kernel itself
19716 + sometime after 1.1.51. Segment support is still buggy and
19717 + therefore disabled. If programs assume they know what segments
19718 + exist it they are broken anyway!
19722 +Wed Sep 14 11:24:18 BST 1994
19724 + * Added extra fcntl code 14 (used by SVR4 for GETLCK).
19728 +Tue Sep 6 10:58:49 BST 1994
19730 + * Added setting of fsuid/fsgid to the loaders and changed the
19731 + eaccess() function in xnx.c to flip fsuid/fsgid rather than
19732 + uid/gid. If you were having problems with setuid/setgid iBCS
19733 + binaries this is likely to help.
19737 +Mon Sep 5 15:07:06 BST 1994
19739 + * Fixed the bad initialisation of howcnv in signal.c.
19743 +Fri Sep 2 11:01:26 BST 1994
19745 + * Added a little program to the Tools subdirectory which will
19746 + restamp old binaries with the Linux machine type rather than
19747 + zero which is used by BSD. Once this is done you can reliably
19748 + distinguish between BSD and Linux binaries (the current Linux
19749 + linker will set the correct machine type on all new binaries).
19752 + * Updated the BSD patch.
19755 + * Changed binfmt_coff to avoid passing meaningless MAP_DENYWRITE
19756 + and MAP_EXECUTABLE flags to mmap when we are not actually
19757 + mapping from a file. It would probably never be a problem...
19761 +Tue Aug 23 17:21:45 BST 1994
19763 + * Added my device trace stub in case anyone needs to investigate
19764 + and emulate some special device.
19768 +Wed Aug 17 14:06:34 BST 1994
19770 + * Added an extern definition of the formats list needed by
19771 + the 1.0.x hooks. Presumably this went AWOL at some stage?
19775 +Fri Aug 12 09:52:38 BST 1994
19777 + * Slight change to the socksys major allocation. Removed
19778 + redundant error message.
19782 +Wed Aug 10 08:57:32 BST 1994
19784 + * Added the spelling corrections from the 1.1.42 kernel patch.
19788 +Fri Aug 5 10:05:14 BST 1994
19790 + * Added Scott Michel's SCO multiscreen patches.
19793 + * More changes to loaders for latest kernel changes.
19797 +Wed Jul 27 10:59:14 BST 1994
19799 + * Changes for 1.1.36 vm/mprotect.
19803 +Tue Jul 26 14:20:27 BST 1994
19805 + * Tidied up the system call maps a little. ISC is now handled
19806 + by the same maps as SCO.
19810 +Wed Jul 20 12:39:55 BST 1994
19812 + * Removed the lock.patch. This is in the latest kernels.
19815 + * Changed the socksys/SCO utsname stuff to do the right thing
19816 + if we have the hostname set to the fqdn and the domainname
19817 + set to the NIS domain. If hostname is not an fqdn we assume
19818 + we are using the domainname == IP domain convention.
19822 +Wed Jun 29 13:34:34 BST 1994
19824 + * Revised the lock.patch to fix the unlock problem and allow
19825 + locks on devices. This should go to Linus (and probably has).
19828 + * Removed the kernel 1.1.20 patch. This isn't needed as of
19833 +Mon Jun 27 09:26:24 BST 1994
19835 + * Can't use select() for nap() since the Linux select system
19836 + call expects to pull its arguments from the user stack.
19837 + Rewritten nap() using itimers.
19840 + * More fixes from Eric for 1.0 compatibility.
19844 +Fri Jun 24 09:37:50 BST 1994
19846 + * Added a bit about time zones to the HINTS file.
19849 + * First draft of BSD termios mapping. Still buggy. Needs
19850 + work to be useful.
19853 + * Fixed BSD getdirentries() to align dirents on long word
19854 + boundaries. 'ls' now works and 'tcsh' finds and executes
19855 + commands successfully.
19858 + * ibcs_exit should be listed in callmap.inc with arg count 1
19862 +Thu Jun 23 09:48:43 BST 1994
19864 + * Lots more BSD-ish stuff. Commit now for release since there is
19865 + confusion over versions at the moment.
19868 + * List Xess MOTIF spreadsheet in COMPAT file.
19869 + -- Michael K.Johnson <johnsonm@merengue.oit.unc.edu>
19871 + * When slurping in mis-aligned COFF binaries we shouldn't be
19872 + aligning the file offset and virtual address to a page
19876 + * Merged Eric's latest patches for 1.0 compatibility and Linux
19877 + ELF capability. This was done by hand. I think it's perfect...
19881 +Wed Jun 22 14:28:38 BST 1994
19883 + * Many sigsuspend entries in the callmap had argumetn counts
19884 + of 1 instead of Spl. This caused kernel faults.
19887 + * Implemented the ioctls for the pseudo nfs device which under
19888 + SCO is used to get/set the NIS domain. You need to link
19889 + /dev/nfsd to /dev/socksys.
19892 + * The socksys getdomainname() was doing the same write null to
19893 + kernel space instead of user space as the wysev386 version.
19897 +Tue Jun 21 08:54:34 BST 1994
19899 + * Use the map_bitvec() function (added as part of the BSD changes)
19900 + in signal.c. Note that there were quite a few mapping bugs in
19901 + the old code. I think I got them all but few would have been
19902 + triggered by my SCO and Wyse stuff.
19905 + * Snapshot BSD stuff again ready for release.
19908 + * binfmt_coff.c and binfmt_xout.c should be using mmap(NULL,...)
19909 + instead of zeromap_page_range as this will create the vm area
19910 + descriptor as well as mapping the pages. This is needed for
19911 + the verify_area() in 1.1.20 which has tighter checks than
19912 + previous versions.
19915 + * Map stack region as a GROWSDOWN vm area in binfmt_elf.c
19919 +Fri Jun 17 16:42:59 BST 1994
19921 + * Major and on going work to add BSD support (optional - see the
19922 + Makefile). I'm committing this now so I have a current tree
19923 + ready for release when Linus goes to 1.1.20.
19926 + * Wyse get{host,domain}name were using direct assignment to add
19927 + a trailing null instead of put_fs_byte(). Oops...
19930 + * Changes for execution domain support which will be in the main
19931 + kernel as of 1.1.20. This allows easy registration of lcall7
19932 + handlers, binary loaders etc. for different personalities.
19936 +Fri Jun 10 10:12:55 BST 1994
19938 + * Added patch file for kernel locking from Niklas Hallqvist
19939 + <niklas@appli.se>. This (or something very similar) should
19940 + end up in the kernel at some stage.
19943 + * Merged Eric's changes for 1.0 compatibilty - or rather didn't.
19944 + After playing with diff for quite a while I finally realised
19945 + we'd both done exactly the same changes :-). However Eric
19946 + has tested them...
19949 + * Added Brandon's iBCS trace binary from Eric's 1.0 compatibility
19954 +Thu Jun 9 10:22:56 BST 1994
19956 + * Mapped msgsys to ibcs_msgsys in callmap.inc. It existed, we
19957 + just didn't admit it before :-).
19961 +Tue Jun 7 08:50:34 BST 1994
19963 + * Sorted out some more ioctl stuff and added a handler for the
19964 + STREAMS ioctl set. This is needed for I_NREAD (number of
19965 + characters readable). Some SYSV X libraries contain implicit
19966 + assumptions that the X connection is via a STREAM and use
19967 + I_NREAD in preference to BSD/socket FIONREAD.
19970 + * Oh, Jeez... The changes made for the official kernel patches
19971 + completely shafted the 1.0 compatibility. I've remerged the
19972 + previous code with the new code - there may still be some
19973 + things that need pulling back though. At this point I don't
19974 + have a 1.0 kernel tree around to test against.
19977 + * If a COFF program is not correctly aligned disable demand
19978 + paging and resort to slurping the whole lot in at start up.
19981 + * Added missing -I../include to the Tools Makefile.
19985 +Fri Jun 3 11:53:21 BST 1994
19987 + * Added my virtual system tools. A virtualised SCO 3.2.4
19988 + system is usable for real work for me...
19991 + * Added the synchronous ioctl set. This conflicts with the
19992 + SCO 3.2.x (x < 4) ioctl for getting the video map so it should
19993 + be dependent on the file descriptor it is applied to but since
19994 + we don't currently support either...
19998 +Thu Jun 2 17:02:26 BST 1994
20000 + * Added support for FIORDCHK ioctl. SCO says it's there for
20001 + "backward compatibility" but the system programs still
20002 + seem to use it (notably ksh).
20006 +Tue May 31 13:39:34 BST 1994
20008 + * Patches to sysfs.c for 1.0.x compatibility from Tor with
20009 + some extra clean up.
20013 +Fri May 27 09:15:21 BST 1994
20015 + * Ensure we set up signal() handlers as SA_ONESHOT and sigaction()
20016 + handlers as sticky - similar to patch from Remete Gabor.
20019 + * Added the SCO cxenix sigaction extensions. Barely tested...
20022 + * Added the cxenix {get,set}itimer calls discovered on SCO by
20023 + Brandon. Currently these are directly mapped to the Linux
20024 + syscalls. They are undocumented by SCO (as far as we know)
20025 + and untested by us (for now).
20029 +Thu May 26 11:58:18 BST 1994
20031 + * Don't include the 0.0.0.0 to localhost address mapping if we
20032 + are building for 1.1.15+. This is mapped in the kernel as of
20033 + 1.1.6 and since we don't support 1.1 kernels before 15...
20036 + * Type of signal map vectors should be unsigned long not int.
20039 + * Allow tracing to be compiled in to the COFF loader and turned
20040 + on and off with the Tools/trace program.
20043 + * Signal maps moved out to maps/signal.inc. The only special
20044 + mapping that happens is for ISC which has a problem with
20045 + Oracle sending SIGSTOP to its backend when SIGSTOP doesn't
20046 + appear to be defined for ISC. We just map SIGSTOP to 0 so
20047 + it appears to work but does nothing.
20050 + * Changes for 1.1.15. This will not work with kernels between
20051 + 1.1.10 and 1.1.14 inclusive - guaranteed. It should still
20052 + work with the 1.0.x series but has not been tested recently.
20053 + It probably works against 1.1.0 to 1.1.13 inclusive but that
20054 + is purely coincidence - you shouldn't be using old 1.1.x
20055 + kernels as it's a development series.
20059 +Tue May 24 17:27:54 1994 Eric Youngdale (eric@tantalus)
20061 + * binfmt_xout.c: Use linux_binfmt struct, register_binfmt,
20062 + unregister_binfmt as in pl14.
20064 + * binfmt_elf.c, binfmt_xout.c: Likewise.
20066 + * signals.c: Make signals[] and lsignals[] global variables.
20068 + * ibcs/include/ibcs.h: Add prototypes for signals[] and lsignals[].
20071 +Tue May 24 10:37:01 BST 1994
20073 + * Added map entries for the ISC personality to all the maps
20074 + files. Must be more careful adding personalities.
20077 + * Added Oracle to the COMPAT file.
20080 + * Remember the problem with interrupting an Informix 4GL program
20081 + causing it to go psycho because of I/O errors from the tty?
20082 + Well, this doesn't happen with the new tty drivers in 1.1.13.
20083 + I never found why it happened...
20086 + * Noted that the 1.1.11 kernel patches are still ok with 1.1.13.
20090 +Mon May 23 08:50:21 BST 1994
20092 + * Mapped ISC sysconf() to the existing Xenix sysconf(). This
20093 + looks right but isn't checked at all.
20096 + * Added ISC TCSETPGRP and TCGETPGRP ioctl traps.
20100 +Thu May 19 09:26:34 BST 1994
20102 + * Added a bug hunting section to the README.
20105 + * Always access the socket layer by picking up the file operations
20106 + from an open socket descriptor. This removes the need for
20107 + kernel socket functions to be global and should be friendlier
20108 + towards a loadable socket layer one day.
20112 +Mon May 16 10:20:38 BST 1994
20114 + * Always access system calls via the system call table regardless
20115 + of whether we are using a loadable module or linking directly
20116 + to the kernel. This allows other things to be loadable too.
20120 +Wed May 11 13:52:12 BST 1994
20122 + * Added a tip on how to fix X font problems to the HINTS file.
20123 + Other "soft" changes welcome. Does anyone read the ChangeLog?
20126 + * Introduced the PROD.Patches directory and put the WP install
20127 + fixes in there. Documented in COMPAT and README.
20130 + * Added some hints on incompatible shell behaviour.
20134 +Mon May 9 11:07:52 BST 1994
20136 + * Updated the 1.1 patch file for 1.1.11.
20139 + * Additions for Interactive 4.0
20140 + -- Karl Kiniger (ki@kretz.co.at)
20143 +Fri May 6 12:03:00 BST 1994
20145 + * Merged old sysfs.c with the new sysfs.c. The code will now
20146 + work against any kernel - 1.0, 1.1, 1.1.9, 1.1.10...
20150 +Thu May 5 10:39:52 BST 1994
20152 + * Reworked for compatibility with 1.1.10. Kernel patches
20153 + are *not* updated yet. We expect the kernel changes to go
20154 + in to the official distribution any time now...
20158 +Tue May 3 12:03:31 BST 1994
20160 + * Joe/Brad's IPC additions.
20163 +Fri Apr 29 10:06:10 BST 1994
20165 + * Updated the README to explain the difference between sysfs.c
20170 +Wed Apr 27 11:38:52 BST 1994
20172 + * Added mapping of chsize() to ftruncate(). Implemented nap()
20176 + * Further fix to termios mapping for iexten and tostop.
20179 + * Updated the 1.1.? patch. New ksyms.c with fewer symbols plus
20180 + removed all the socket patches. Sockfunc.h is no longer
20181 + required. The 1.0 patch isn't updated but the extra cruft
20182 + that's in there now shouldn't be any problem.
20186 +Tue Apr 26 11:49:07 BST 1994
20188 + * Removed references to linux/sockfunc.h. We seem to have run
20189 + out of internal socket functions to put in it finally.
20192 + * Removed use of socki_lookup(). This just wraps some checks
20193 + around inode->i_socket. We assume the socket layer is stable
20197 + * Access [gs]etsockopt via the socketcall interface.
20200 + * If we have to use our own CFLAGS look in the include directory
20201 + above in case we have been dropped in to the kernel.
20204 + * Grab socket file operations when we create a socket rather
20205 + than linking against them directly. Similar to Eric's
20206 + changes but different...
20210 +Fri Apr 22 11:10:18 BST 1994
20212 + * The 'x' class of ioctls are back to being termios rather
20213 + than termio. The problem was that the field size in iBCS
20214 + termios and Linux termios is different.
20217 + * Added iBCS <-> Linux termios mapping. This is untested and
20218 + probably imperfect at this stage but nothing crashes with
20222 + * The iBCS time() syscall doesn't take an argument, the save,
20223 + if any, is handled in the interface library.
20226 + * Updated the 1.1 kernel patch to be against 1.1.8. It won't
20227 + work with anything less than 1.1.8 but then if you are
20228 + playing with 1.1 you should be playing with the latest...
20229 + This involves a change in the way sysfs() works. If you
20230 + are using 1.0 and have applications that call sysfs()
20231 + (practically none do) then you need to build with sysfs.c.old.
20234 + * The Linux kernel 1.1.8 replaces the static file_systems
20235 + table with a linked list ready for loadable file systems.
20236 + Naturally, I was ready for this... :-(
20240 +Thu Apr 21 10:34:34 BST 1994
20242 + * sysfs.c should be including linux/string.h to get the
20243 + inline string functions rather than needing library
20247 + * Added code to map between Linux termio structs and SCO/iBCS
20248 + termio structs. There are slight differences. Mapping needs
20249 + to be done for termios structs too. Anything that uses termios
20250 + at this stage is likely to ge a nasty shock!
20254 +Tue Apr 19 22:56:55 1994 Eric Youngdale (eric@esp22)
20256 + * ibcs.h: Put declaration of sys_call_table outside of ifdef.
20257 + (So can be compiled into kernel instead as a module).
20260 +Tue Apr 19 10:21:17 BST 1994
20262 + * It looks as though the 'x' class of ioctls should be termio
20263 + ioctls rather than termios. At least this is the case as far
20264 + as SCO 3.2.4 stty appears to be concerned.
20267 + * Avoid copying the entire lock structure backwards and forwards
20268 + just to increment one field in open.c. There could be a problem
20269 + here - SCO has a sysid field *before* the pid field but only
20270 + if _XOPEN_SOURCE or _POSIX_SOURCE is defined at compile time.
20271 + There appears to be no obvious way to know what is being used???
20275 +Mon Apr 18 08:49:37 BST 1994
20277 + * There appear to odd little niceties involved with SYSV which
20278 + depend on system configuration and the way users do things.
20279 + Added a HINTS file with known problems/workarounds.
20282 + * Changed some annoying KERN_ERRs to KERN_DEBUGs in signal.c
20285 + * Watch out for (mis)use of INADDR_ANY instead of localhost
20286 + (primarily by syslog() code?) and replace it with the
20287 + localhost address. We should perhaps do this for sendto()
20288 + as well? (Eric spotted this one on CorelDraw but it's a
20289 + problem with the standard libsocket.c)
20292 + * Processes should be allowed to reduce their file size
20293 + limit but only increase it if they have root privileges.
20296 + * Fixed the bug in [f]statfs where the first two arguments
20297 + to memcpt_tofs() were exchanged (spotted by Eric).
20300 + * SCO seems to like utsys (v7_utsname) to return the same
20301 + thing for sysname and nodename fields just like the SCO
20302 + extended utsname structure has. The SVR4 (abi_utsname)
20303 + return is unknown at this time.
20306 + * Removed comments on IPC from README. It *is* fixed?
20309 + * Fix IPC which was broken by syscall changes. Also fix
20310 + structure mappings.
20311 + -- Joseph L. Portman III <baron@hebron.connected.com>
20314 +Thu Apr 14 11:27:24 BST 1994
20316 + * At some stage SCO managed to build some of their binaries
20317 + with the copyright comment string in quotes so we have a
20318 + new recognition string in the COFF loader. (Seen in uname
20319 + on a 3.2.2 system).
20322 + * If we have tracing compiled in then only give unsupported
20323 + syscall messages if we are tracing the API or the syscall
20324 + in question. This allows us to quieten unsupported but
20325 + unimportant syscalls.
20328 + * Comment on the IPC limitations in the README file.
20331 + * Added implementation of xnx_pathconf(). Actually it doesn't
20332 + look as if we really need it. The Microsoft C compiler seems
20333 + to be misusing it anyway and doesn't even care that it gets
20338 +Wed Apr 13 09:14:50 BST 1994
20340 + * Added handling of TIOC[GS]PGRP.
20343 + * Added implementation of xnx_eaccess(). This is currently
20344 + simpleminded because Linux access() is. My eaccess() may
20348 + * When tracing signal delivery we shouldn't be clearing the
20349 + signal flag after reporting it or the signal is never actually
20350 + delivered. I copied the assembler from the kernel and forgot
20351 + to deleted an opcode...
20354 + * Signal 0 should have been identity mapped so kill 0 works.
20355 + -- Brandon S. Allbery (kf8nh@kf8nh.ampr.org) (bsa@kf8nh.wariat.org)
20357 +Tue Apr 12 14:30:25 BST 1994
20359 + * Corrected file size passed to/from setrlimit/getrlimit
20360 + -- Graham Adams (gadams@ddrive.demon.co.uk)
20363 +Tue Apr 12 11:16:45 BST 1994
20365 + * Added support for an obscure SCO extension that is used
20366 + to get SCO's extended utsname information.
20369 + * Changed ipc.c to always go via the ipc syscall rather than
20370 + direct to internal functions. This should survive if ipc
20371 + isn't in the kernel. It should even do sensible things if
20372 + the ipc module is loaded/unloaded on us.
20375 + * Initial changes to access system calls via sys_call_table
20381 + * Eric's pre-release fixes.
20384 +Wed Mar 30 22:35:28 1994 Eric Youngdale (eric@esp22)
20386 + * ioctl.c: Change 'F' to 'f' for SVr4 FIONREAD ioctl.
20388 + * Makefile: Add svr4.c.
20390 + * svr4.c: New file (sort of - it got lost in shuffle before).
20392 + * include/ibcs/ibcs.h: Include prototypes for abi_uname.
20394 + * maps/callmap.inc: Insert abi_uname in syscall number 135.
20395 + Add sys_rename in slot 134 (emacs v18 requires this).
20398 +Tue Mar 29 23:32:35 1994 Eric Youngdale (eric@esp22)
20400 + * Makefile: Fix so that we do not need uname. Use symbol from
20403 + * README: Update a bit.
20408 + * Preparation for release:
20409 + Tidy up documentation and create CREDITS file from the old
20416 + * Preparation for release:
20417 + Move headers into a subdirectory.
20418 + Move maps into a subdirectory.
20424 + * Changed the COFF loader so that if the filesystem doesn't
20425 + support mmap we read in the whole lot initially and let
20426 + it page to swap if necessary. This is already in the x.out
20427 + loader, it should go in the ELF loader too at some point.
20433 + * Added a loader for x.out i386 small model binaries - i.e 386
20434 + Xenix programs. <=286, non-small model binaries are not
20435 + supported and not likely to be in the near future.
20439 +Wed Mar 23 23:12:54 1994 Eric Youngdale (eric@esp22)
20441 + * Add ioctl for 0x4004667f (FIONREAD) (used by SVr4).
20443 + * map.h (map_segment.map): Make unsigned.
20445 + * hrtsys.c: New file implementing parts of the hrtsys syscall.
20450 + * Add socket value mappings. This meant a general move round
20451 + to tidy things up and group map functions/tables.
20452 + There is a new kernel patch in the Patches directory called
20453 + net.patch which gives us access to the sock_*sockopts
20454 + functions directly.
20460 + * Implementation of poll().
20466 + * Pedantic change to call maps so that IBCS_function contains
20467 + a void * instead of a function pointer - we cast it as
20468 + necessary later in emulate.c. The warnings were annoying me.
20470 + * Moved struct abi_sigaction from signal.c to abi4.h so it is
20471 + available for prototype declarations. Changed prototype for
20472 + abi_sigsuspend to correspond to implementation in signal.c.
20475 + * Reversed out Eric's earlier signal patches and added new ones.
20478 + * Updated trace code and trace control program to be useful.
20479 + Control of tracing individual functions is still not there
20480 + yet - perhaps another day.
20481 + Default trace mode is now none (i.e. only functions with
20482 + the trace flag set are traced). Use the trace program to
20483 + change the trace level.
20486 + * File modes (open/fcntl flags) are different between Linux and
20487 + iBCS so we need to map between them. Open also requires this
20488 + so fcntl.c is now merged with open.c. Failure to set and reset
20489 + non-blocking mode was what was breaking Unipox.
20492 + * Signal handling function changes to map to and from the Linux
20493 + signal set and sigaction flags correctly.
20499 + * Added code to the emulate() function to let us know when we
20500 + are about to process a signal on exit from the syscall.
20503 + * Implemented proctl() as a no-op. It's not really relevent
20507 + * Added argument count and type for eaccess()
20510 + * Have emulate.c return -ENOSYS for unimplemented system calls
20511 + rather than zero.
20514 + * Added Eric's patches to waitpid.
20516 + * Created the ChangeLog!
20517 diff -Nru linux-2.6.7/Documentation/abi/COMPAT linux-2.6.7-abi/Documentation/abi/COMPAT
20518 --- linux-2.6.7/Documentation/abi/COMPAT 1970-01-01 01:00:00.000000000 +0100
20519 +++ linux-2.6.7-abi/Documentation/abi/COMPAT 2004-07-22 17:44:20.000000000 +0200
20521 +C: This file contains details of programs that have been run under
20522 +C: Linux using the iBCS emulator. An entry here is no guarantee that
20523 +C: the program works 100% but does indicate that the major elements
20524 +C: of the program have been unable to exercise bugs in the emulator
20525 +C: unless otherwise noted.
20527 +C: An entry in this file does not necessarily indicate that the vendor
20528 +C: or anyone else actually supports the package under Linux unless
20529 +C: there is a specific entry to that effect.
20531 +C: Please add to this file - new entries, other releases, amendments
20532 +C: to existing entries etc.
20534 +C: The layout of this file is intended to be both easy to browse and
20535 +C: easy to parse, allowing it to be formatted into documents in the
20536 +C: future. This hasn't happened yet though and might never happen :-).
20541 +C: S = Support details
20542 +C: O = Operating system compiled for
20544 +C: R = Release(s) known to work
20545 +C: L = Libraries required
20546 +C: D = Description
20550 +V: Applied Information Systems, Inc. (info@ais.com)
20552 +P: Xess (MOTIF Spreadsheet)
20554 +L: statically linked
20555 +N: A save-disabled demo is available in ftp.uu.net:/vendor/ais/
20556 +N: Get three files: README, gen.tar, and sco.tar.
20557 +N: Don't add a .Z or .gz to the end of the filenames; the files
20558 +N: inside are compressed. ~300K of online documentation is in
20560 +N: If anyone decides to actually *buy* this product, *please*
20561 +N: mention that you will be running it under Linux. I promise
20562 +N: you that you will still get technical support (the majority
20563 +N: of our technical support staff run Linux at home) -- but if
20564 +N: enough people buy the product asking for a Linux version, my
20565 +N: employer will be willing to make the investment. Pass the
20566 +N: word on if you want to see a native-mode, high-quality
20567 +N: spreadsheet for Linux as much as I do...
20568 +N: michaelkjohnson
20569 +T: Michael K.Johnson <johnsonm@merengue.oit.unc.edu>
20573 +P: CorelDraw! 3.0 and friends.
20575 +N: Requires X11, no character versions of these apps.
20576 +N: Everything seems to be statically linked, no extra libs
20577 +N: necessary. I had a few problems with my .xmodmap file
20578 +N: since CorelDraw wants all of the lower function keys to
20579 +N: be mapped to functions in the CorelDraw program. Uses a
20580 +N: networked license manager, it worked fine. My programs
20581 +N: did not install properly due to an install bug. The dir.
20582 +N: that contains the washes.3fx file and others must be hand
20583 +N: changed to mode 777 for CorelChart to work (This from
20584 +N: Corel tech support).
20585 +T: Doug Ledford <gdl297s@cnas.smsu.edu>
20589 +P: Informix SQL Standard Engine
20592 +T: Mike Jagdis <jaggy@purplet.demon.co.uk>
20596 +P: Informix SQL Online Dynamic Server
20598 +T: Mike Jagdis <jaggy@purplet.demon.co.uk>
20602 +N: INET is reputed to work too but I can't remember who
20610 +L: /shlib/libnsl_s
20611 +N: The version of X.desktop tested is that shipped with
20612 +N: Uniplex Windows. Functionality is at least enough to
20613 +N: support Uniplex Windows.
20614 +T: Mike Jagdis <jaggy@purplet.demon.co.uk>
20620 +L: /shlib/libnsl_s
20621 +T: Remete Gabor <rg@tomx.elte.hu>
20625 +P: Tactician Plus (character and X)
20627 +T: Brandon S. Allbery <bsa@kf8nh.wariat.org>
20631 +P: SPSS 5.0 for SCO UNIX
20632 +L: Motif, if you want to use the GUI
20633 +D: Statistical Package for the Social Sciences
20634 +N: SCO's cpio is not compatible with GNU's -- I had to dd all
20635 +N: floppys onto my hd and to concatenate them into one file.
20636 +N: I couldn't test the GUI since I had no Motif available.
20637 +T: Joerg Rade <jr@petz.han.de>
20639 +V: Uniplex Limited
20641 +P: Uniplex / Uniplex Windows
20643 +L: statically linked (Uniplex Windows requires libnsl_s)
20644 +N: Uniplex Windows is implemented using a version of IXI
20645 +N: X.desktop. It is this that requires libnsl_s.
20646 +T: Mike Jagdis <jaggy@purplet.demon.co.uk>
20648 +V: V-Systems, Inc.
20650 +P: VSI*FAX (FxServer, FxScript, FxVision) (character and X)
20651 +R: FxServer 2.0.19, FxScript 1.1.05, FxVision 1.0.16
20652 +L: Statically linked
20653 +N: Needs localhost in the X server's access control list
20654 +N: even when using a local X connection.
20655 +N: This has not been tested with a modem connected as I
20656 +N: don't have a Multitech...
20657 +T: Mike Jagdis <jaggy@purplet.demon.co.uk>
20663 +T: Mark C. Henderson <mch@sqwest.wimsey.bc.ca>
20665 +V: WordPerfect Corporation
20667 +P: WordPerfect (character and X)
20669 +L: Statically linked
20670 +N: Installation under Linux may require changes to some of
20671 +N: the WP install scripts. See the PROD.Patches/WP file
20674 +N: WP uses a network license manager.
20676 +N: For some reason WP use a partition floppy device rather
20677 +N: than the full block device. Linux does not have this so
20678 +N: you need to use dd to skip the first cylinder (track?)
20679 +N: when loading the floppies under Linux. See the HINTS
20680 +N: file for details.
20682 +N: Fonts appear corrupt. See the HINTS file for a cure.
20683 +T: Mike Jagdis <jaggy@purplet.demon.co.uk>
20689 +L: Statically linked - Motif based.
20690 +N: Installation scripts work correctly.
20692 +N: ZMail can use a network license manager or a license file.
20693 +N: Both are known to work.
20695 +N: ZMail is a GUI-based mail program.
20697 +N: You can download the binaries for ZMail via anonymous ftp
20699 +N: You will have to contact Z-Code to obtain an evaluation
20700 +N: license if you wish to try it out.
20701 +T: Eric Youngdale <eric@aib.com>
20702 diff -Nru linux-2.6.7/Documentation/abi/CREDITS linux-2.6.7-abi/Documentation/abi/CREDITS
20703 --- linux-2.6.7/Documentation/abi/CREDITS 1970-01-01 01:00:00.000000000 +0100
20704 +++ linux-2.6.7-abi/Documentation/abi/CREDITS 2004-07-22 17:44:20.000000000 +0200
20706 +A (non-definitive) list of people who appear to have worked on the
20707 +emulator and, in some cases, what they appear to have done.
20709 +This list is in no particular order.
20711 +This list should probably be better maintained :-).
20713 +If anyone feels that they are not properly credited here, send diffs to
20717 +========================================================================
20719 +Brandon S. Allbery <bsa@kf8nh.wariat.org> or <kf8nh@kf8nh.ampr.org>
20721 +Graham Adams <gadams@ddrive.demon.co.uk>
20723 +Tor Arntsen <tor@tss.no> or <tor@spacetec.no>
20724 + Emulator as of pl13
20726 +Philip Balister <balister@vt.edu>
20727 + Emulator as of pl13
20730 +Alfred Longyear <longyear@netcom.com>
20732 + Emulator as of pl12
20733 + Original author of libc_s. COFF version.
20735 +Mike Jagdis <jaggy@purplet.demon.co.uk>
20736 + Changes for loadable module version of the emulator.
20737 + Multi-personality detection and syscall mapping.
20738 + Error code mapping.
20739 + Wyse V/386 socket interface.
20740 + /dev/socksys socket interface.
20741 + /dev/spx to Unix domain socket for local X connections.
20742 + Named pipe to Unix domain socket open kludge.
20743 + XTI/TLI STREAMS based networking interface.
20744 + X.out loader for 386 Xenix binaries.
20746 + Trace dummy device.
20747 + Segment (LDT) mapping for x.out binaries.
20748 + Xenix 286 emulator overlay.
20749 + Current source maintainer and primary developer.
20751 +Joseph L. Portman III <baron@hebron.connected.com>
20752 + Major emulator developer.
20755 +Drew Sullivan <drew@lethe.north.net>
20756 + Past emulator source maintainer.
20758 +Eric Youngdale <eric@aib.com> (prev. <eric@cais.com> & <ericy@gnu.ai.mit.edu>)
20759 + First cut of the emulator.
20760 + ELF loader, plus memory manager and fs/exec.c modifications
20761 + to allow multiple binary formats to be loaded.
20762 + Keeper of the tsx-11 archive.
20763 + libc_s (elf version), plus bugfixes, reorganization, etc.
20764 + SVr4 portions of emulator.
20766 +Karl Kiniger <ki@kretz.co.at>
20767 + Interactive 4.0 binary recognition and special support.
20769 +Remete Gabor <rg@tomx.elte.hu>
20770 + Miscellaneous patches.
20772 +Scott Michel <scottm@intime.com>
20773 + SCO multiscreen ioctls.
20775 +Stephan Riess <Stephan.Riess@Physik.TU-Muenchen.de>
20778 +Peter Polte <peter@cat-productions.de>
20779 + Xenix fcntl() file locking facilities.
20781 +C.A. Lademann <cal@zls.com>
20783 +Miguel de Icaza <miguel@roxanne.nuclecu.unam.mx>
20785 diff -Nru linux-2.6.7/Documentation/abi/Error.map linux-2.6.7-abi/Documentation/abi/Error.map
20786 --- linux-2.6.7/Documentation/abi/Error.map 1970-01-01 01:00:00.000000000 +0100
20787 +++ linux-2.6.7-abi/Documentation/abi/Error.map 2004-07-22 17:44:20.000000000 +0200
20789 +Mapping of error codes from Linux to various personalities. Codes which Linux
20790 +may generate but which can't be mapped directly in a given personality must
20791 +be mapped to the nearest equivalent which may invoke the correct behaviour
20792 +in the application. This is especially true for things like the ERESTART*
20793 +set of error returns!
20797 +The Xenix set was built with reference to an old SCO Xenix manual rather
20798 +than by reference to a real system. It may be incomplete or wrong. If anyone
20799 +has access to the Xenix TCP/IP kit we need to add mappings for the TCP/IP
20802 +Other personalities may need adding. COFF binaries default
20804 +Linux Name Linux ABI SCO Wyse Xenix 386bsd
20806 +EPERM 1 /* Operation not permitted */
20807 +ENOENT 2 /* No such file or directory */
20808 +ESRCH 3 /* No such process */
20809 +EINTR 4 /* Interrupted system call */
20810 +EIO 5 /* I/O error */
20811 +ENXIO 6 /* No such device or address */
20812 +E2BIG 7 /* Arg list too long */
20813 +ENOEXEC 8 /* Exec format error */
20814 +EBADF 9 /* Bad file number */
20815 +ECHILD 10 /* No child processes */
20816 +EAGAIN 11 35 /* Try again */
20817 +ENOMEM 12 /* Out of memory */
20818 +EACCES 13 /* Permission denied */
20819 +EFAULT 14 /* Bad address */
20820 +ENOTBLK 15 /* Block device required */
20821 +EBUSY 16 /* Device or resource busy */
20822 +EEXIST 17 /* File exists */
20823 +EXDEV 18 /* Cross-device link */
20824 +ENODEV 19 /* No such device */
20825 +ENOTDIR 20 /* Not a directory */
20826 +EISDIR 21 /* Is a directory */
20827 +EINVAL 22 /* Invalid argument */
20828 +ENFILE 23 /* File table overflow */
20829 +EMFILE 24 /* Too many open files */
20830 +ENOTTY 25 /* Not a typewriter */
20831 +ETXTBSY 26 /* Text file busy */
20832 +EFBIG 27 /* File too large */
20833 +ENOSPC 28 /* No space left on device */
20834 +ESPIPE 29 /* Illegal seek */
20835 +EROFS 30 /* Read-only file system */
20836 +EMLINK 31 /* Too many links */
20837 +EPIPE 32 /* Broken pipe */
20838 +EDOM 33 /* Math argument out of domain of func */
20839 +ERANGE 34 /* Math result not representable */
20840 +EDEADLK 35 45 45 45 36 11 /* Resource deadlock would occur */
20841 +ENAMETOOLONG 36 78 78 228 EINVAL 63 /* File name too long */
20842 +ENOLCK 37 46 46 46 45 77 /* No record locks available */
20843 +ENOSYS 38 89 89 EINVAL EINVAL 78 /* Function not implemented */
20844 +ENOTEMPTY 39 93 145 231 EINVAL 66 /* Directory not empty */
20845 +ELOOP 40 90 150 227 EINVAL 62 /* Too many symbolic links encountered */
20846 +EWOULDBLOCK EAGAIN 90 90 200 EINVAL 35 /* Operation would block */
20847 +ENOMSG 42 35 35 35 43 ? /* No message of desired type */
20848 +EIDRM 43 36 36 36 44 ? /* Identifier removed */
20849 +ECHRNG 44 37 37 37 EINVAL ? /* Channel number out of range */
20850 +EL2NSYNC 45 38 38 38 EINVAL ? /* Level 2 not synchronized */
20851 +EL3HLT 46 39 39 39 EINVAL ? /* Level 3 halted */
20852 +EL3RST 47 40 40 40 EINVAL ? /* Level 3 reset */
20853 +ELNRNG 48 41 41 41 EINVAL ? /* Link number out of range */
20854 +EUNATCH 49 42 42 42 EINVAL ? /* Protocol driver not attached */
20855 +ENOCSI 50 43 43 43 EINVAL ? /* No CSI structure available */
20856 +EL2HLT 51 44 44 44 EINVAL ? /* Level 2 halted */
20857 +EBADE 52 ? 50 50 EINVAL ? /* Invalid exchange */
20858 +EBADR 53 ? 51 51 EINVAL ? /* Invalid request descriptor */
20859 +EXFULL 54 ? 52 52 EINVAL ? /* Exchange full */
20860 +ENOANO 55 ? 53 53 EINVAL ? /* No anode */
20861 +EBADRQC 56 ? 54 54 EINVAL ? /* Invalid request code */
20862 +EBADSLT 57 ? 55 55 EINVAL ? /* Invalid slot */
20863 +EDEADLOCK 58 ? 56 56 36 11 /* File locking deadlock error */
20864 +EBFONT 59 ? 57 57 EINVAL ? /* Bad font file format */
20865 +ENOSTR 60 EINVAL ? /* Device not a stream */
20866 +ENODATA 61 EINVAL ? /* No data available */
20867 +ETIME 62 EINVAL ? /* Timer expired */
20868 +ENOSR 63 EINVAL ? /* Out of streams resources */
20869 +ENONET 64 EINVAL ? /* Machine is not on the network */
20870 +ENOPKG 65 EINVAL ? /* Package not installed */
20871 +EREMOTE 66 EINVAL 71 /* Object is remote */
20872 +ENOLINK 67 EINVAL ? /* Link has been severed */
20873 +EADV 68 EINVAL ? /* Advertise error */
20874 +ESRMNT 69 EINVAL ? /* Srmount error */
20875 +ECOMM 70 EINVAL ? /* Communication error on send */
20876 +EPROTO 71 ? ? /* Protocol error */
20877 +EMULTIHOP 72 74 74 74 ? ? /* Multihop attempted */
20878 +EDOTDOT 73 76 76 76 ? ? /* RFS specific error */
20879 +EBADMSG 74 77 77 77 ? ? /* Not a data message */
20880 +EOVERFLOW 75 79 EINVAL EINVAL ? ? /* Value too large for defined data type */
20881 +ENOTUNIQ 76 80 80 80 ? ? /* Name not unique on network */
20882 +EBADFD 77 81 81 81 ? ? /* File descriptor in bad state */
20883 +EREMCHG 78 82 82 82 ? ? /* Remote address changed */
20884 +ELIBACC 79 83 83 83 ? ? /* Can not access a needed shared library */
20885 +ELIBBAD 80 84 84 84 ? ? /* Accessing a corrupted shared library */
20886 +ELIBSCN 81 85 85 85 ? ? /* .lib section in a.out corrupted */
20887 +ELIBMAX 82 86 86 86 ? ? /* Attempting to link in too many shared libraries */
20888 +ELIBEXEC 83 87 87 87 ? ? /* Cannot exec a shared library directly */
20889 +EILSEQ 84 88 EINVAL EINVAL ? ? /* Illegal byte sequence */
20890 +ERESTART 85 91 EINTR EINTR ? ? /* Interrupted system call should be restarted */
20891 +ESTRPIPE 86 92 EINVAL EINVAL ? ? /* Streams pipe error */
20892 +EUSERS 87 94 EINVAL 233 ? 68 /* Too many users */
20893 +ENOTSOCK 88 95 93 203 ? 38 /* Socket operation on non-socket */
20894 +EDESTADDRREQ 89 96 94 204 ? 39 /* Destination address required */
20895 +EMSGSIZE 90 97 95 205 ? 40 /* Message too long */
20896 +EPROTOTYPE 91 98 96 206 ? 41 /* Protocol wrong type for socket */
20897 +ENOPROTOOPT 92 99 EINVAL 207 ? 42 /* Protocol not available */
20898 +EPROTONOSUPPORT 93 120 97 208 ? 43 /* Protocol not supported */
20899 +ESOCKTNOSUPPORT 94 121 98 209 ? 44 /* Socket type not supported */
20900 +EOPNOTSUPP 95 122 99 210 ? 45 /* Operation not supported on transport endpoint */
20901 +EPFNOSUPPORT 96 123 100 211 ? 46 /* Protocol family not supported */
20902 +EAFNOSUPPORT 97 124 101 212 ? 47 /* Address family not supported by protocol */
20903 +EADDRINUSE 98 125 102 213 ? 48 /* Address already in use */
20904 +EADDRNOTAVAIL 99 126 103 214 ? 49 /* Cannot assign requested address */
20905 +ENETDOWN 100 127 104 215 ? 50 /* Network is down */
20906 +ENETUNREACH 101 128 105 216 ? 51 /* Network is unreachable */
20907 +ENETRESET 102 129 106 217 ? 52 /* Network dropped connection because of reset */
20908 +ECONNABORTED 103 130 107 218 ? 53 /* Software caused connection abort */
20909 +ECONNRESET 104 131 108 219 ? 54 /* Connection reset by peer */
20910 +ENOBUFS 105 132 63 220 ? 55 /* No buffer space available */
20911 +EISCONN 106 133 110 221 ? 56 /* Transport endpoint is already connected */
20912 +ENOTCONN 107 134 111 222 ? 57 /* Transport endpoint is not connected */
20913 +ESHUTDOWN 108 143 112 223 ? 58 /* Cannot send after transport endpoint shutdown */
20914 +ETOOMANYREFS 109 144 113 224 ? 59 /* Too many references: cannot splice */
20915 +ETIMEDOUT 110 145 114 225 ? 60 /* Connection timed out */
20916 +ECONNREFUSED 111 146 115 226 ? 61 /* Connection refused */
20917 +EHOSTDOWN 112 147 116 229 ? 64 /* Host is down */
20918 +EHOSTUNREACH 113 148 117 230 ? 65 /* No route to host */
20919 +EALREADY 114 149 92 202 ? 37 /* Operation already in progress */
20920 +EINPROGRESS 115 150 91 201 ? 36 /* Operation now in progress */
20921 +ESTALE 116 EINVAL EINVAL 237 ? 70 /* Stale NFS file handle */
20922 +EUCLEAN 117 ? 135 135 35 ? /* Structure needs cleaning */
20923 +ENOTNAM 118 ? 137 137 37 ? /* Not a XENIX named type file */
20924 +ENAVAIL 119 ? 138 138 38 ? /* No XENIX semaphores available */
20925 +EISNAM 120 ? 139 139 39 ? /* Is a named type file */
20926 +EREMOTEIO 121 ? 140 140 EINVAL ? /* Remote I/O error */
20927 +EDQUOT 122 ? ENOSPC 234 ENOSPC 69 /* Quota exceeded */
20929 +ERESTARTSYS 512 EINTR EINTR EINTR EINTR EINTR
20930 +ERESTARTNOINTR 513 EINTR EINTR EINTR EINTR EINTR
20931 +ERESTARTNOHAND 514 EINTR EINTR EINTR EINTR EINTR /* restart if no handler.. */
20932 diff -Nru linux-2.6.7/Documentation/abi/HINTS linux-2.6.7-abi/Documentation/abi/HINTS
20933 --- linux-2.6.7/Documentation/abi/HINTS 1970-01-01 01:00:00.000000000 +0100
20934 +++ linux-2.6.7-abi/Documentation/abi/HINTS 2004-07-22 17:44:20.000000000 +0200
20937 + Cannot determine user name by reference to /etc/passwd. Failure
20938 + to determine the user name causes some programs (notably programs
20939 + built with Informix 4GL) to exit.
20942 + The functions that parse /etc/passwd are sensitive under SCO
20943 + at least. A corrupt line is taken to be the end of the file
20944 + and further entries are ignored. Any line which has a null
20945 + home directory counts as a corrupt line for SCO.
20948 + Ensure that all lines in /etc/passwd have home directories
20949 + specified. Simply edit /etc/passwd with an editor.
20952 +# -----------------------------------------------------------------------
20955 + Cannot connect to X server using local connection.
20958 + Some versions of X libraries seem to require 'localhost' to be
20959 + allowed to connect to the X server even if we aren't using a
20960 + TCP/IP connection. The X libraries used for VSI*FAX require
20961 + this, the X libraries used for WordPerfect don't.
20964 + Explicitly allow 'localhost' to connect to the X server using
20965 + 'xhost localhost'.
20968 +# -----------------------------------------------------------------------
20971 + Installation disks claim to be Unix tar format but they appear
20972 + to be blank MS-DOS format disks!
20975 + Unix provides two floppy devices, the normal floppy devices
20976 + that we all know and love (and which are listed as the Xenix
20977 + compatible devices in the man page) and a second set which
20978 + skips the first track of the disk. For some reason a few vendors
20979 + seem to use this second set when preparing distribution disks.
20980 + WordPerfect seem to do this. Linux currently only supports
20981 + the normal floppy devices.
20984 + You have to skip the first track by hand and read each disk
20985 + individually. Try 'dd if=/dev/fd0 bs=18k skip=1 | tar xfv -'
20986 + for a 3.5" high density disk. Change the 18k to 15k for a
20987 + 5.25" high density disk.
20989 +# -----------------------------------------------------------------------
20992 + A script bombs out with an unexpected EOF looking for "'". This
20993 + only happens on Linux.
20996 + There is a bug in the script which is only a problem on Linux.
20997 + Take the following example:
20999 + count=`ls | wc | awk '{ printf "%05d", $1 }`
21001 + Note the missing "'" at the end of the awk statment. The /bin/sh
21002 + supplied with SCO will assume (in this case correctly) that the
21003 + "'" should have occurred immediately before the closing "`" and
21004 + the expression will succeed. The /bin/sh used with Linux (normally
21005 + bash) does not make this assumption and gives an error message.
21008 + Either fix the script or arrange to have it run by a SYSV shell
21009 + rather than bash.
21011 +# -----------------------------------------------------------------------
21014 + Test complains that a numeric argument is required before -eq, -le
21018 + The GNU shellutils test and the test built in to bash which are
21019 + the versions of test used under Linux do not accept a null
21020 + argument as equivalent to 0 so 'test "" -le 5' will give an error.
21021 + Under SCO a null argument is taken as equivalent to 0 so the
21022 + statement would be evaluated as 'test 0 -le 5'.
21025 + Fix the script to check arguments for validity before using them
21026 + or provide a fixed version of test and ensure that it is used in
21027 + preference to any shell built in.
21029 +# -----------------------------------------------------------------------
21032 + Some X fonts supplied with packages appear corrupt.
21035 + These are probably snf fonts. The XFree86 X server used with
21036 + Linux appears to fail to load some snf fonts silently and displays
21037 + garbage. Pcf fonts work ok and should be used where possible.
21040 + If you only have the snf fonts all you can do is to try asking the
21041 + vendor for pcf versions or the bdf definitions.
21043 + If you have the bdf definitions (WordPerfect ship them) then you
21044 + can build a pcf set using:
21046 + # for bdffn in *.bdf
21048 + > fn=`basename $bdffn .bdf`
21049 + > [ -r $fn.snf ] && mv $fn.snf $fn.snf.old
21050 + > bdftopcf -o $fn.pcf $bdffn
21055 +# -----------------------------------------------------------------------
21058 + Function keys don't work.
21061 + The default sequences for function keys under Linux are "sort of"
21062 + VT10x like whereas you have probably told your application that
21063 + you are running on an ansi or SCO console.
21066 + It is probably best to run as an ansi screen - especially if
21067 + colour is used - so use the "loadkeys" program to load the
21068 + SCO.map keyboard description from the PROD.Patches directory.
21069 + This directory also contains flexible termcap and terminfo
21070 + descriptions which will allow you run permanently with a SCO
21071 + or SVR4-like console.
21073 +# -----------------------------------------------------------------------
21076 + Line drawing characters come out as weird symbols.
21079 + The application believes you are using a console screen with a
21080 + PC character set and is using 8-bit codes rather than escape
21081 + sequences. Linux defaults to an ISO8859-1 character set though.
21084 + Linux can be switched to PC character set mode with the escape
21085 + sequence ESC-(-U. Arrange to have this sequence sent either
21086 + before the application is started or as part of the initialisation
21087 + that the application does. You can restore the ISO character
21088 + set afterwards with ESC-(-K.
21090 +# -----------------------------------------------------------------------
21093 + SYSV binaries see the wrong time zone.
21096 + SYSV binaries establish the time zone from the TZ environment
21097 + variable whereas Linux uses BSD style zoneinfo files generally.
21100 + Set the TZ environment variable to reflect your time zone. Note
21101 + that the zoneinfo mechanism can also use TZ in preference to
21102 + the /usr/lib/zoneinfo/localtime file if you wish. For this to
21103 + work you must have /usr/lib/zoneinfo/posixrules linked to one
21104 + of the US timezone files. The posixrules file defines how the
21105 + zoneinfo functions interpret TZ and this information is only
21106 + found in the US data files. See the documentation for the
21107 + timezone/zoneinfo package for details.
21109 +# -----------------------------------------------------------------------
21112 + BSD binaries don't see the right time zone.
21115 + Although BSD binaries use the same timezone handling method as
21116 + Linux they expect the zoneinfo information in different places.
21121 + # ln -s /usr/lib/zoneinfo /etc/localtime
21122 + # ln -s /usr/lib/zoneinfo /usr/share/zoneinfo
21124 +# -----------------------------------------------------------------------
21127 + BSD binaries complain that they can't find /etc/termcap.
21130 + They may be lying. BSD sometimes uses /usr/share/misc/termcap
21131 + or ~/.termcap (if it exists).
21134 + Either move termcap to /usr/share/misc and make /etc/termcap
21135 + a link to it or make /usr/share/misc/termcap a link to /etc/termcap.
21136 + The use of /usr/share/misc/termcap may be useful in a networked
21138 +# -----------------------------------------------------------------------
21141 + SVr4 binaries cannot locate shared libraries, or fail to start.
21144 + The shared libraries are not in the correct location, or the dynamic
21145 + loader cannot be located by the kernel.
21148 + Put all SVr4 shared libraries in the directory /usr/i486-sysv4/lib.
21149 + Then create two symbolic links:
21151 + ln -s /usr/i486-sysv4/lib/libc.so.1 /usr/lib/libc.so.1
21152 + ln -s /usr/i486-sysv4/lib/ld.so.1 /usr/lib/ld.so.1
21153 +# -----------------------------------------------------------------------
21156 + SVr4 binaries want to access terminfo instead of termcap
21159 + SVr4 traditionally uses something called terminfo instead of
21160 + termcap to specify terminal characteristics.
21163 + The ncurses distribution (available on many fine ftp sites)
21164 + contains a terminfo database. Just install this, and you
21165 + should be all set.
21166 +# -----------------------------------------------------------------------
21169 + The Informix Dynamic Server installation for SCO says
21170 + invalid INFORMIXDIR or insufficient space.
21173 + It wants to scan /etc/mnttab to find all possible
21174 + filesystems. Since Linux uses /etc/mtab instead the
21175 + installation program is under the impression you have
21176 + no filesystems and no space(!).
21179 + Run the perl script Tools/mkmnttab which will build an
21180 + /etc/mnttab from /etc/mtab.
21181 diff -Nru linux-2.6.7/Documentation/abi/Local-X linux-2.6.7-abi/Documentation/abi/Local-X
21182 --- linux-2.6.7/Documentation/abi/Local-X 1970-01-01 01:00:00.000000000 +0100
21183 +++ linux-2.6.7-abi/Documentation/abi/Local-X 2004-07-22 17:44:20.000000000 +0200
21185 +** Local X interface
21187 +The local X interface is simplistic. It assumes only one local X server
21188 +exists and assumes that the pathname of the Unix domain socket for
21189 +local connections is always /tmp/.X11-unix/X0.
21191 + The SCO code opens both /dev/X0R and /dev/spx, writes a single byte
21192 +to /dev/X0R, reads a message from /dev/X0R with getmsg then writes this
21193 +message to /dev/spx with putmsg and closes /dev/X0R. This establishes
21194 +the /dev/spx file descriptor as a connection to the X server listening
21197 + We ignore all activity on the /dev/X0R device (hence it is a link to
21198 +/dev/null), getmsg and putmsg are stubbed so don't do anything and opens
21199 +on the /dev/spx simply replace the open inode with a socket connected
21200 +to the X server's Unix domain socket.
21202 + At some point in the future we will implement a simple minded /dev/X*
21203 +driver that returns some form of id via the getmsg which can then be
21204 +passed to /dev/spx with putmsg and which will allow /dev/spx to connect
21205 +to the relevant X server. This will only happen if someone actually
21206 +*needs* multiple local X servers...
21207 diff -Nru linux-2.6.7/Documentation/abi/modules.txt linux-2.6.7-abi/Documentation/abi/modules.txt
21208 --- linux-2.6.7/Documentation/abi/modules.txt 1970-01-01 01:00:00.000000000 +0100
21209 +++ linux-2.6.7-abi/Documentation/abi/modules.txt 2004-07-22 17:44:20.000000000 +0200
21211 +A brief overview of the Linux-ABI modules
21213 +Christoph Hellwig, <hch@caldera.de>
21215 +Linux-ABI consists of a number of loadable kernel modules (you can also
21216 +compile it directly into the kernel, but no one actually does). This
21217 +document is intended to give a brief overview on the aviable modules
21218 +and how they can be classified in groups.
21221 +=== Binary format modules
21223 +Some of the personalities supported by Linux-ABI use different binary
21224 +formats than the ELF format that is used by Linux native binaries.
21225 +The follwoing binary format modules do exists:
21229 + This modules supports the COFF binary format as used by elder
21230 + SysV-derivate operating systems. It is used by the SVR3,
21231 + SCOSVR3, ISC and Wyse personalities.
21235 + This module is intended for loading X.out binaries generated for
21236 + the Xenix operating system.
21238 +These modules have to be loaded manually before using them.
21242 +=== Personality modules
21244 +Personality modules contain the the personality implementation and are
21245 +thus the hearts of Linux-ABI. Additionally most personality modules
21246 +contain syscalls only used by that particular personality. There are
21247 +a lot of personality modules:
21251 + Support for plain SVR3/SVR4 as specified in iBCS2 or iABI4.
21252 + Additionally this module contains the Xenix and ISC personalities,
21253 + but these should be moved away from here.
21257 + This module implements the SCO Unix 3.x/ODT and OSR5 personalities.
21261 + The Solaris 2 emulator.
21265 + SCO UnixWare 7 / Caldera OpenUnix 8 emulator.
21269 + Support for Wyse V/386 ant it's multiprocessor variant.
21272 +=== Backend modules
21274 +As a lot of the functionality provided by the binary format modules is
21275 +common to more than one of those, most of this functionality is moved to
21276 +backend modules. There are only a few backend modules:
21280 + The machine depandand part of Linux-ABI (in fact currently
21281 + Linux-ABI is i386-specific, but that _will_ change).
21285 + Most of the syscalls used by all or many of the SVR3/SVR4 derivates.
21289 + 4BSD-style socket interface, currently only used by the Wyse
21290 + emulation. This will probably go away.
21291 diff -Nru linux-2.6.7/Documentation/abi/Notes.Signal linux-2.6.7-abi/Documentation/abi/Notes.Signal
21292 --- linux-2.6.7/Documentation/abi/Notes.Signal 1970-01-01 01:00:00.000000000 +0100
21293 +++ linux-2.6.7-abi/Documentation/abi/Notes.Signal 2004-07-22 17:44:20.000000000 +0200
21295 +Drew, Joe, and Brandon.
21297 +This file contains my code for the signal functions. I realized that the
21298 +existing signal functions will not suffice. This module should do the
21299 +proper processing for iBCS signals.
21301 +There are patches to the emulate module offered by Drew in his pl14n code
21302 +release. The Makefile was changed to include the module.
21304 +In addition, I have include a signal.doc file which contains the text from
21305 +my UNIX S5 manual describing the functions used by iBCS. I based the
21306 +emulator code on this document. Please look it over and see if I have
21307 +messed up. I believe it to be correct. However, it never hurts to have
21308 +someone check the work before we can trust it.
21310 +It follows what I believe to be the proper calling sequence for signals. I
21311 +sent a message to the IBSC2 group with the text from the McGraw Hill book
21312 +concerning signals. If you would like a copy of the message, then let me
21315 +Of couse, this could be totally wrong. That is the whole point about
21316 +sending this out to a limited distribution.
21318 +In addition to the processing for the various function requests, you may
21319 +have noticed that the signal _numbers_ must be changed between the values
21320 +used by iBCS and Linux.
21322 +I have had to modify the emulate.c module to export an additional
21323 +procedure (and for emulate.c to use the procedure itself.) In addition, I
21324 +change the branch table to re-direct the signal processing to the signal.c
21327 +I hope that this will help the project when it has been proven workable.
21328 +Please let me know how this turns out -- one way or the other.
21330 +If it does work, then I'll give the final code to Drew to merge into the
21331 +master code. That is unless, Drew, you already have it. :-)
21336 +Al Longyear longyear@netcom.com longyear@sii.com
21337 diff -Nru linux-2.6.7/Documentation/abi/Personality linux-2.6.7-abi/Documentation/abi/Personality
21338 --- linux-2.6.7/Documentation/abi/Personality 1970-01-01 01:00:00.000000000 +0100
21339 +++ linux-2.6.7-abi/Documentation/abi/Personality 2004-07-22 17:44:20.000000000 +0200
21341 +*** Why are multiple personalities necessary?
21343 +Personalities are used to provide the expected set of syscalls and error
21344 +code mapping for non-Linux processes. In theory the set of syscalls and
21345 +error codes should be standardised across all SYSV systems. In practice
21346 +this is the case for SVR4, however SVR3 is a much older code base and
21347 +many vendors have extended it leading to incompatibilities between the
21348 +expected interfaces. Personalities allow us to vary the interface presented
21349 +on a per-process basis thus allowing Linux to run binaries created for
21350 +different vendor's extended SVR3s simultaneously.
21353 +*** How are personalities implemented?
21355 +The per-process task structure contains a field "personality". This defaults
21356 +to 0 for Linux binaries, 1 (SVR4) for ELF binaries and 2 (SVR3) for COFF
21357 +binaries. However when the COFF loader is called on to load a new binary
21358 +it looks at the first 1k of data in each .comment section and compares
21359 +the strings it finds with a built in table. If it finds a match it will
21360 +set the personality appropriately.
21362 + When the application makes a system call the iBCS emulation layer uses
21363 +the personality code in the per-process task structure to determine which
21364 +system call mappings to use to locate the correct function.
21366 + If the function returns an (Linux) error code the iBCS emulation layer
21367 +uses the personality code to determine which error code mappings to use
21368 +to translate the error code in to a value the application will understand.
21371 +*** What personalities are implemented?
21373 +Currently the implemented personalities are SVR4, SVR3 (as a direct
21374 +subset of SVR4), SCO 3.[24] and Wyse V/386 3.2.1. Of these the Wyse
21375 +emulation is the most complete at this time. Rather than using the
21376 +more common streams based TCP/IP stack on their SVR3, Wyse used a BSD
21377 +implementation with a system call interface. Currently the Wyse emulation
21378 +is the only one capable of running non-Linux TCP/IP binaries.
21381 +*** When do I need to add a personality rather than use the default?
21383 +When your applications start failing for inexplicable reasons! Seriously,
21384 +if you have an SVR3 based Unix which does not currently have its own
21385 +personality defined then you should check some things very carefully.
21387 + Firstly compare your system's /usr/include/sys/errno.h with the data
21388 +in the Error.map file. If the values defined in your errno.h do not
21389 +match those in the ABI column then you will need to create a new
21390 +personality in order to map error codes to the correct values.
21392 + Next compare your system's /usr/include/sys.s with the data in the
21393 +Syscall.map file. If there are system calls in your sys.s that don't
21394 +do the same thing as those in the ABI column (other than ones that
21395 +simply aren't implemented on your system) then you will need to create
21396 +a new personality in order to mapp system calls to the correct functions.
21399 +*** How do I add a new personality?
21401 +The first step is to find a way for the COFF loader to recognise your
21402 +binaries as being different. To do this you need to examine the comments
21403 +embedded in a range of binaries, system executables, bought programs of
21404 +various ages and locally compiled programs, using "mcs -p" to list the
21405 +.comments sections. If you don't have "mcs" use "strings" and look for
21406 +version or copyright messages. You are looking for one or more strings
21407 +near the top which uniquely identify the system.
21409 + Once you have your identifying strings you must add a value for the
21410 +new personality to linux/include/linux/personality.h (just use the
21411 +next highest number) and add the strings to the table in the COFF loader
21412 +linux/fs/binfmt_coff.c.
21414 + The next step is to modify the error map. Edit the file errmap.inc and
21415 +look at the end of the file where there is an array of pointers to error
21416 +maps call err_map. There is one entry for each personality. Add a new
21417 +entry to the end for your personality. If your personality is compatible
21418 +with an exising personality you can simply reuse the same error map (see
21419 +the duplicate entries for the SVR4 map which is use for both SVR4 and
21420 +SVR3 personalities), otherwise you must figure out how to create a new
21421 +error mapping. One day it may be documented here :-).
21423 + Next you must modify the syscall mapping. Edit the file callmap.inc
21424 +and look at the end of the file where there is an array containg one
21425 +pointer for each personality. Add a new entry to the end. If your syscalls
21426 +match one of the existing personalities you may reuse the existing map.
21427 +Otherwise you have to build a new one. Again, one day it may be documented
21429 diff -Nru linux-2.6.7/Documentation/abi/README.first linux-2.6.7-abi/Documentation/abi/README.first
21430 --- linux-2.6.7/Documentation/abi/README.first 1970-01-01 01:00:00.000000000 +0100
21431 +++ linux-2.6.7-abi/Documentation/abi/README.first 2004-07-22 17:44:20.000000000 +0200
21433 +First notes on Linux-ABI documentation
21435 +Christoph Hellwig, <hch@caldera.de>
21438 +Please note that most files in this directory are leftovers from iBCS, which is
21439 +dead since 1998. Do not expect this files to uptodate or complete.
21441 +I will update the files and add new onces from time to time.
21445 diff -Nru linux-2.6.7/Documentation/abi/Syscall.map linux-2.6.7-abi/Documentation/abi/Syscall.map
21446 --- linux-2.6.7/Documentation/abi/Syscall.map 1970-01-01 01:00:00.000000000 +0100
21447 +++ linux-2.6.7-abi/Documentation/abi/Syscall.map 2004-07-22 17:44:20.000000000 +0200
21449 +Call ABI SCO 3.2 SCO 3.4 Wyse V/386 3.2.1 386bsd
21468 + 18 stat getfsstat
21479 + 29 pause recvfrom
21481 + 31 stty getpeername
21482 + 32 gtty getsockname
21485 + 35 statfs fchflags
21489 + 39 setpgrp getppid
21495 + 45 lock/plock ktrace
21496 + 46 setgid sigaction
21498 + 48 signal sigprocmask
21499 + 49 msgsys getlogin
21500 + 50 sysi86/sys3b setlogin
21502 + 52 shmsys sigpending
21503 + 53 semsys sigaltstack
21507 + 57 utssys symlink
21513 + 63 ulimit getkerninfo
21514 + 64 ??? getpagesize
21522 + 72 rmount vadvise
21523 + 73 rumount munmap
21524 + 74 rfstart mprotect
21526 + 76 rdebug vhangup
21529 + 79 rmdir getgroups
21530 + 80 mkdir setgroups
21531 + 81 getdents getpgrp
21532 + 82 libattach setpgid
21533 + 83 libdetach setitimer
21536 + 86 putmsg getitimer
21537 + 87 poll gethostname
21538 + 88 lstat --- --- --- sethostname
21539 + 89 symlink --- --- --- getdtablesize
21540 + 90 readlink --- symlink --- dup2
21541 + 91 setgroups --- lstat --- ---
21542 + 92 getgroups --- readlink --- fcntl
21543 + 93 fchmod --- --- --- select
21544 + 94 fchown --- --- --- ---
21545 + 95 sigprocmask --- --- --- fsync
21546 + 96 sigsuspend --- --- --- setpriority
21547 + 97 sigaltstack --- --- --- socket
21548 + 98 sigaction --- --- --- connect
21549 + 99 sigpending --- --- --- accept
21550 +100 context --- --- --- getpriority
21551 +101 evsys --- --- --- send
21552 +102 evtrapret --- --- --- recv
21553 +103 statvfs --- --- --- sigreturn
21554 +104 fstatvfs --- --- --- bind
21555 +105 ??? setsockopt
21556 +106 nfssys --- --- --- listen
21557 +107 waitsys --- --- --- vtimes
21558 +108 sigsendsys --- --- --- sigvec
21559 +109 hrtsys --- --- --- sigblock
21560 +110 acancel --- --- --- sigsetmask
21561 +111 async --- --- --- sigsuspend
21562 +112 priocntlsys --- --- --- sigstack
21563 +113 pathconf --- --- --- recvmsg
21564 +114 mincore --- --- --- sendmsg
21565 +115 mmap --- --- --- vtrace
21566 +116 mprotect --- --- --- gettimeofday
21567 +117 munmap --- --- --- getrusage
21568 +118 fpathconf --- --- --- getsockopt
21569 +119 vfork --- --- --- resuba
21570 +120 fchdir --- --- --- readv
21571 +121 readv --- --- --- writev
21572 +122 writev --- --- --- settimeofday
21573 +123 xstat --- --- --- fchown
21574 +124 lxstat --- --- --- fchmod
21575 +125 fxstat --- --- --- recvfrom
21576 +126 xmknod --- --- --- setreuid
21577 +127 clocal setregid
21578 +128 setrlimit --- --- lstat rename
21579 +129 getrlimit --- --- readlink truncate
21580 +130 lchown --- --- symlink ftruncate
21581 +131 memcntl --- --- --- flock
21582 +132 getpmsg --- --- --- mkfifo
21583 +133 putpmsg --- --- gethostname sendto
21584 +134 rename --- --- sethostname shutdown
21585 +135 uname --- --- getdomainname socketpair
21586 +136 setegid --- --- setdomainname mkdir
21587 +137 sysconfig --- --- --- rmdir
21588 +138 adjtime --- --- setreuid utimes
21589 +139 systeminfo --- --- setregid sigreturn
21591 +141 seteuid --- --- --- getpeername
21592 +142 --- --- --- --- gethostid
21593 +143 --- --- --- --- sethostid
21594 +144 --- --- --- --- getrlimit
21595 +145 --- --- --- --- setrlimit
21596 +146 --- --- --- --- killpg
21597 +147 --- --- --- --- setsid
21598 +148 --- --- --- --- quotactl
21599 +149 --- --- --- --- quota
21600 +150 --- --- --- --- getsockname
21601 +151 --- --- --- ---
21602 +152 --- --- --- ---
21603 +153 --- --- --- ---
21604 +154 --- --- --- ---
21605 +155 --- --- --- --- nfssvc
21606 +156 --- --- --- --- getdirentries
21607 +157 --- --- --- --- statfs
21608 +158 --- --- --- --- fstatfs
21609 +159 --- --- --- ---
21610 +160 --- --- --- --- async_daemon
21611 +161 --- --- --- --- getfh
21612 +162 --- --- --- --- getdomainname
21613 +163 --- --- --- --- setdomainname
21614 +164 --- --- --- --- uname
21615 +165 --- --- --- --- sysarch
21616 +166 --- --- --- ---
21617 +167 --- --- --- ---
21618 +168 --- --- --- ---
21619 +169 --- --- --- --- semsys
21620 +170 --- --- --- --- msgsys
21621 +171 --- --- --- --- shmsys
21622 +172 --- --- --- ---
21623 +173 --- --- --- ---
21624 +174 --- --- --- ---
21625 +175 --- --- --- --- ntp_gettime
21626 +176 --- --- --- --- ntp_adjtime
21627 +177 --- --- --- --- vm_allocate
21628 +178 --- --- --- --- vm_deallocate
21629 +179 --- --- --- --- vm_inherit
21630 +180 --- --- --- --- vm_protect
21631 +181 --- --- --- --- setgid
21632 +182 --- --- --- --- setegid
21633 +183 --- --- --- --- seteuid
21634 diff -Nru linux-2.6.7/Documentation/abi/TODO.ibcs linux-2.6.7-abi/Documentation/abi/TODO.ibcs
21635 --- linux-2.6.7/Documentation/abi/TODO.ibcs 1970-01-01 01:00:00.000000000 +0100
21636 +++ linux-2.6.7-abi/Documentation/abi/TODO.ibcs 2004-07-22 17:44:20.000000000 +0200
21639 + These are leftovers from iBCS, I just removed what is already
21640 + done in linux-abi or isn't relevant for us. --hch
21643 +^Z disconnects but the next read seems to return an error instead
21644 +of blocking? (Fixed?)
21646 +SIOGIFFLAGS seems to get passed an empty string as the interface name
21647 +(ISC ping). What is supposed to be happening?
21649 +If a timod putmsg fails we should set an error status on the socket and
21650 +return it on future calls for strict compatibility. Currently we recover
21651 +from things such as protocol errors rather more than we should.
21653 +Getmsg() - when select returns we may not be the first process to wake
21654 +up and handle the event. So the recvfrom ought to be non-blocking (not
21655 +possible?). If it would block we should go back to the select (unless
21656 +the descriptor is in non-blocking mode). (DONE?)
21658 +How should we go about returning TLOOK? Currently we are only working
21659 +synchronously so it isn't essential yet. It looks like it's all handled
21662 +The T_MORE flag on t_snd() and t_rcv() marks message boundaries. Strictly
21663 +these should be preserved end-to-end. Possible across sockets?
21664 +(X/Open specify that message boundaries shouldn't be relied on with TCP)
21666 +Need I_SETSIG ioctl to enable SIGPOLL on available input etc. Note that
21667 +a control message counts as input. This should interface with poll() too.
21669 +getmsg() returns EINTR if a signal interrupts it but the t_*() functions
21670 +don't seem to propogate this back to the application. Presumably they
21673 +The SCO timod doesn't seem to pay much attention to the TI_* command
21674 +in an ioctl but uses the T_* primitive in the message block. i.e. if
21675 +you have T_BIND_REQ in the message but TI_GETINFO as the ioctl command
21676 +timod will do a bind. Currently we use the TI_* by preference. This
21677 +needs to change to avoid breaking programs that worked on SCO even
21678 +though broken. It shouldn't be _essential_ though as all this is
21679 +normally hidden in libnsl_s so should be consistent.
21681 +Connects are currently forced synchronous. It wouldn't be too much
21682 +to allow them to happen asynchronously but the async confirmation
21683 +is supposed to contain the address we connected to and that is only
21684 +available from the connection request message. Unless we save it
21685 +somewhere or look it up from the socket. Hang on, we have getpeername()
21688 +There are slight semantic differences between O_NDELAY and O_NONBLOCK
21689 +which cause different behaviour on SCO at least. For instance O_NDELAY
21690 +does cause t_connect to work asynchronously but O_NONBLOCK doesn't.
21691 +Under Linux O_NDELAY and O_NONBLOCK are the same. This could cause
21692 +problems at some point I guess...
21694 +Under SCO at least poll and select are different. Poll works on things
21695 +that select can be used on but select cannot necessarily work on things
21696 +that can be polled. Specifically you can poll a transport end point
21697 +but not select on it. Badly written programs could block when they
21698 +wouldn't normally.
21699 diff -Nru linux-2.6.7/fs/binfmt_coff.c linux-2.6.7-abi/fs/binfmt_coff.c
21700 --- linux-2.6.7/fs/binfmt_coff.c 1970-01-01 01:00:00.000000000 +0100
21701 +++ linux-2.6.7-abi/fs/binfmt_coff.c 2004-07-22 17:44:21.000000000 +0200
21704 + * These are the functions used to load COFF IBCS style executables.
21705 + * Information on COFF format may be obtained in either the Intel Binary
21706 + * Compatibility Specification 2 or O'Rilley's book on COFF. The shared
21707 + * libraries are defined only the in the Intel book.
21709 + * This file is based upon code written by Eric Youngdale for the ELF object
21712 + * Author: Al Longyear (longyear@sii.com)
21717 +#include <linux/module.h>
21718 +#include <linux/fs.h>
21719 +#include <linux/stat.h>
21720 +#include <linux/sched.h>
21721 +#include <linux/init.h>
21722 +#include <linux/kernel.h>
21723 +#include <linux/mm.h>
21724 +#include <linux/mman.h>
21725 +#include <linux/a.out.h>
21726 +#include <linux/errno.h>
21727 +#include <linux/signal.h>
21728 +#include <linux/binfmts.h>
21729 +#include <linux/string.h>
21730 +#include <linux/fcntl.h>
21731 +#include <linux/ptrace.h>
21732 +#include <linux/coff.h>
21733 +#include <linux/slab.h>
21734 +#include <linux/personality.h>
21735 +#include <linux/file.h>
21736 +#include <linux/unistd.h>
21737 +#include <linux/syscalls.h>
21738 +#include <asm/uaccess.h>
21741 +#ifndef EXPORT_NO_SYMBOLS
21742 +#define EXPORT_NO_SYMBOLS
21745 +MODULE_DESCRIPTION("Support for the SVR3 COFF binary format");
21746 +MODULE_AUTHOR("Al Longyear, Christoph Hellwig");
21747 +MODULE_LICENSE("GPL");
21749 +EXPORT_NO_SYMBOLS;
21752 +static int coff_load_binary(struct linux_binprm *, struct pt_regs *);
21753 +static int coff_load_shlib(struct file *);
21754 +static int coff_preload_shlibs(struct linux_binprm *, COFF_SCNHDR *, int);
21755 +static int coff_parse_comments(struct file *, COFF_SCNHDR *, long *);
21758 +static struct linux_binfmt coff_format = {
21759 + NULL, THIS_MODULE, coff_load_binary, coff_load_shlib, NULL, PAGE_SIZE
21763 +typedef struct coff_section {
21769 +typedef struct coff_clue {
21770 + short terminal; /* non-zero to stop parsing with this entry */
21771 + short len; /* negative number uses strstr for lookup */
21772 + char *text; /* text to search for */
21773 + u_long mask_and, mask_or;
21778 + * The following table gives clues to the "personality" of the executable
21779 + * which we hope to find in the .comment sections of the binary.
21780 + * The set here may not be comprehensive even for those systems listed.
21781 + * Use 'mcs -p' to list the .comments sections of a binary to see what
21782 + * clues might be there. Or use 'strings' if you don't have mcs.
21784 +static coff_clue coff_clues[] = {
21786 + * Wyse Unix V/386 3.2.1[A].
21788 + {1, 36, "@(#) UNIX System V/386 Release 3.2.1", 0, PER_WYSEV386},
21791 + * SCO Unix V 3.2, 3.2.2, 3.2.4, 3.2.4.2 etc.
21793 + {1, 23, "@(#) crt1.s 1.8 89/05/30", 0, PER_SCOSVR3},
21794 + {1, 16, "@(#)SCO UNIX 3.2", 0, PER_SCOSVR3},
21795 + {1, 18, "\"@(#) SCO UNIX 3.2", 0, PER_SCOSVR3},
21796 + {1, 17, "@(#) SCO UNIX 3.2", 0, PER_SCOSVR3},
21797 + {1, 11, "@(#)SCO 3.2", 0, PER_SCOSVR3},
21800 + * SCO Unix 3.2.4.2 OpenServer 5 gives 32 bit inodes except
21801 + * programs compiled with ods30 compatibilty. In fact OS5
21802 + * always gives 32 bits but the library drops the top 16 in
21803 + * odt30 mode. We know what should happen and do it however.
21805 + {0, 32, "@(#) crt1.s.source 20.1 94/12/04", 0, PER_SCOSVR3},
21806 + {1, 13, "ods_30_compat", ~0, PERF_SHORT_INODE},
21809 + * Interactive (ISC) 4.0.
21811 + {1, -1, "INTERACTIVE", 0, PER_ISCR4},
21820 + * Parse a comments section looking for clues as to the system this
21821 + * was compiled on so we can get the system call interface right.
21824 +coff_parse_comments(struct file *fp, COFF_SCNHDR *sect, long *personality)
21826 + u_long offset, nbytes;
21827 + int hits = 0, err;
21830 + if (!(buffer = (char *)__get_free_page(GFP_KERNEL)))
21834 + * Fetch the size of the section. There must be something in there
21835 + * or the section wouldn't exist at all. We only bother with the
21836 + * first 8192 characters though. There isn't any point getting too
21839 + if ((nbytes = COFF_LONG(sect->s_size)) > 8192)
21842 + offset = COFF_LONG(sect->s_scnptr);
21843 + while (nbytes > 0) {
21844 + u_long count, start = 0;
21847 + err = kernel_read(fp, offset, buffer,
21848 + nbytes > PAGE_SIZE ? PAGE_SIZE : nbytes);
21851 + free_page((u_long) buffer);
21856 + for (count = 0; count < err; count++) {
21860 + c = *(buffer + PAGE_SIZE - 1);
21861 + *(buffer + PAGE_SIZE - 1) = '\0';
21863 + for (clue = coff_clues; clue->len; clue++) {
21864 + if ((clue->len < 0 && strstr(p, clue->text)) ||
21865 + (clue->len > 0 && !strncmp(p, clue->text, clue->len))) {
21866 + *personality &= clue->mask_and;
21867 + *personality |= clue->mask_or;
21868 + if (clue->terminal) {
21869 + free_page((u_long)buffer);
21875 + *(buffer + PAGE_SIZE - 1) = c;
21877 + while (*p && count < err)
21879 + if (count < err) {
21887 + * If we didn't find an end ofstring at all this page
21888 + * probably isn't useful string data.
21897 + free_page((u_long)buffer);
21902 + * Small procedure to test for the proper file alignment.
21903 + * Return the error code if the section is not properly aligned.
21905 +static __inline__ int
21906 +coff_isaligned(COFF_SCNHDR *sectp)
21908 + long scnptr = COFF_LONG(sectp->s_scnptr);
21909 + long vaddr = COFF_LONG(sectp->s_vaddr);
21911 + if ((vaddr - scnptr) & ~PAGE_MASK)
21917 + * Clear the bytes in the last page of data.
21920 +coff_clear_memory(u_long addr, u_long size)
21924 + if ((size = (PAGE_SIZE - (addr & ~PAGE_MASK)) & ~PAGE_MASK) == 0)
21926 + if ((err = verify_area(VERIFY_WRITE, (void *)addr, size)) < 0)
21929 + while (size-- != 0) {
21930 + __put_user(0, (char *)addr);
21938 +static inline unsigned long
21939 +map_coff(struct file *file, coff_section *sect, unsigned long prot,
21940 + unsigned long flag, unsigned long offset)
21942 + unsigned long map_addr;
21944 + down_write(¤t->mm->mmap_sem);
21945 + map_addr = do_mmap(file,
21946 + sect->vaddr & PAGE_MASK,
21947 + sect->size + (sect->vaddr & ~PAGE_MASK),
21948 + prot, flag, offset);
21949 + up_write(¤t->mm->mmap_sem);
21951 + return (map_addr);
21956 +coff_mktables(char *p, int argc, int envc)
21958 + u_long *argv, *envp;
21961 + sp = (u_long *) ((-(u_long)sizeof(char *)) & (u_long)p);
21968 + put_user(argc, --sp);
21969 + current->mm->arg_start = (u_long)p;
21971 + while (argc-- > 0) {
21972 + __put_user(p, argv++);
21973 + p += strlen_user(p);
21976 + __put_user(NULL, argv);
21977 + current->mm->arg_end = current->mm->env_start = (u_long)p;
21979 + while (envc-- > 0) {
21980 + __put_user(p, envp++);
21981 + p += strlen_user(p);
21984 + __put_user(NULL, envp);
21985 + current->mm->env_end = (u_long) p;
21991 + * Helper function to process the load operation.
21994 +coff_load_object(struct linux_binprm *bprm, struct pt_regs *regs, int binary)
21996 + COFF_FILHDR *coff_hdr = NULL;
21997 + COFF_SCNHDR *text_sect = NULL, *data_sect = NULL,
21998 + *bss_sect = NULL, *sect_bufr = NULL,
21999 + *sect_ptr = NULL;
22000 + int text_count = 0, data_count = 0,
22001 + bss_count = 0, lib_count = 0;
22002 + coff_section text, data, bss;
22003 + u_long start_addr = 0, p = bprm->p;
22004 + short flags, aout_size = 0;
22005 + int pageable = 1, sections = 0, status = 0, i;
22006 + int coff_exec_fileno;
22007 + mm_segment_t old_fs;
22010 + coff_hdr = (COFF_FILHDR *)bprm->buf;
22013 + * Validate the magic value for the object file.
22015 + if (COFF_I386BADMAG(*coff_hdr))
22018 + flags = COFF_SHORT(coff_hdr->f_flags);
22021 + * The object file should have 32 BIT little endian format. Do not allow
22022 + * it to have the 16 bit object file flag set as Linux is not able to run
22023 + * on the 80286/80186/8086.
22025 + if ((flags & (COFF_F_AR32WR | COFF_F_AR16WR)) != COFF_F_AR32WR)
22029 + * If the file is not executable then reject the execution. This means
22030 + * that there must not be external references.
22032 + if ((flags & COFF_F_EXEC) == 0)
22036 + * Extract the header information which we need.
22038 + sections = COFF_SHORT(coff_hdr->f_nscns); /* Number of sections */
22039 + aout_size = COFF_SHORT(coff_hdr->f_opthdr); /* Size of opt. headr */
22042 + * There must be at least one section.
22047 + if (!bprm->file->f_op->mmap)
22050 + if (!(sect_bufr = kmalloc(sections * COFF_SCNHSZ, GFP_KERNEL))) {
22051 + printk(KERN_WARNING "coff: kmalloc failed\n");
22055 + status = kernel_read(bprm->file, aout_size + COFF_FILHSZ,
22056 + (char *)sect_bufr, sections * COFF_SCNHSZ);
22057 + if (status < 0) {
22058 + printk(KERN_WARNING "coff: unable to read\n");
22059 + goto out_free_buf;
22062 + status = get_unused_fd();
22063 + if (status < 0) {
22064 + printk(KERN_WARNING "coff: unable to get free fs\n");
22065 + goto out_free_buf;
22068 + get_file(bprm->file);
22069 + fd_install(coff_exec_fileno = status, bprm->file);
22072 + * Loop through the sections and find the various types
22074 + sect_ptr = sect_bufr;
22076 + for (i = 0; i < sections; i++) {
22077 + long int sect_flags = COFF_LONG(sect_ptr->s_flags);
22079 + switch (sect_flags) {
22080 + case COFF_STYP_TEXT:
22081 + status |= coff_isaligned(sect_ptr);
22082 + text_sect = sect_ptr;
22086 + case COFF_STYP_DATA:
22087 + status |= coff_isaligned(sect_ptr);
22088 + data_sect = sect_ptr;
22092 + case COFF_STYP_BSS:
22093 + bss_sect = sect_ptr;
22097 + case COFF_STYP_LIB:
22105 + sect_ptr = (COFF_SCNHDR *) & ((char *) sect_ptr)[COFF_SCNHSZ];
22109 + * If any of the sections weren't properly aligned we aren't
22110 + * going to be able to demand page this executable. Note that
22111 + * at this stage the *only* excuse for having status <= 0 is if
22112 + * the alignment test failed.
22118 + * Ensure that there are the required sections. There must be one
22119 + * text sections and one each of the data and bss sections for an
22120 + * executable. A library may or may not have a data / bss section.
22122 + if (text_count != 1) {
22123 + status = -ENOEXEC;
22124 + goto out_free_file;
22126 + if (binary && (data_count != 1 || bss_count != 1)) {
22127 + status = -ENOEXEC;
22128 + goto out_free_file;
22132 + * If there is no additional header then assume the file starts
22133 + * at the first byte of the text section. This may not be the
22134 + * proper place, so the best solution is to include the optional
22135 + * header. A shared library __MUST__ have an optional header to
22136 + * indicate that it is a shared library.
22138 + if (aout_size == 0) {
22140 + status = -ENOEXEC;
22141 + goto out_free_file;
22143 + start_addr = COFF_LONG(text_sect->s_vaddr);
22144 + } else if (aout_size < (short) COFF_AOUTSZ) {
22145 + status = -ENOEXEC;
22146 + goto out_free_file;
22148 + COFF_AOUTHDR *aout_hdr;
22149 + short aout_magic;
22151 + aout_hdr = (COFF_AOUTHDR *) &((char *)coff_hdr)[COFF_FILHSZ];
22152 + aout_magic = COFF_SHORT(aout_hdr->magic);
22155 + * Validate the magic number in the a.out header. If it is valid then
22156 + * update the starting symbol location. Do not accept these file formats
22157 + * when loading a shared library.
22159 + switch (aout_magic) {
22160 + case COFF_OMAGIC:
22161 + case COFF_ZMAGIC:
22162 + case COFF_STMAGIC:
22164 + status = -ENOEXEC;
22165 + goto out_free_file;
22167 + start_addr = (u_int)COFF_LONG(aout_hdr->entry);
22170 + * Magic value for a shared library. This is valid only when
22171 + * loading a shared library.
22173 + * (There is no need for a start_addr. It won't be used.)
22175 + case COFF_SHMAGIC:
22178 + /* FALLTHROUGH */
22180 + status = -ENOEXEC;
22181 + goto out_free_file;
22186 + * Generate the proper values for the text fields
22188 + * THIS IS THE POINT OF NO RETURN. THE NEW PROCESS WILL TRAP OUT SHOULD
22189 + * SOMETHING FAIL IN THE LOAD SEQUENCE FROM THIS POINT ONWARD.
22192 + text.scnptr = COFF_LONG(text_sect->s_scnptr);
22193 + text.size = COFF_LONG(text_sect->s_size);
22194 + text.vaddr = COFF_LONG(text_sect->s_vaddr);
22197 + * Generate the proper values for the data fields
22200 + if (data_sect != NULL) {
22201 + data.scnptr = COFF_LONG(data_sect->s_scnptr);
22202 + data.size = COFF_LONG(data_sect->s_size);
22203 + data.vaddr = COFF_LONG(data_sect->s_vaddr);
22211 + * Generate the proper values for the bss fields
22214 + if (bss_sect != NULL) {
22215 + bss.size = COFF_LONG(bss_sect->s_size);
22216 + bss.vaddr = COFF_LONG(bss_sect->s_vaddr);
22223 + * Flush the executable from memory. At this point the executable is
22224 + * committed to being defined or a segmentation violation will occur.
22228 + COFF_SCNHDR *sect_ptr2 = sect_bufr;
22229 + u_long personality = PER_SVR3;
22232 + if ((status = flush_old_exec(bprm)))
22233 + goto out_free_file;
22236 + * Look for clues as to the system this binary was compiled
22237 + * on in the comments section(s).
22239 + * Only look at the main binary, not the shared libraries
22240 + * (or would it be better to prefer shared libraries over
22241 + * binaries? Or could they be different???)
22243 + for (i = 0; i < sections; i++) {
22244 + long sect_flags = COFF_LONG(sect_ptr2->s_flags);
22246 + if (sect_flags == COFF_STYP_INFO &&
22247 + (status = coff_parse_comments(bprm->file,
22248 + sect_ptr2, &personality)) > 0)
22251 + sect_ptr2 = (COFF_SCNHDR *) &((char *)sect_ptr2)[COFF_SCNHSZ];
22255 + * If no .comments section was found there is no way to
22256 + * figure out the personality. Odds on it is SCO though...
22258 + personality = abi_defhandler_coff;
22261 + set_personality(personality);
22263 + current->mm->start_data = 0;
22264 + current->mm->end_data = 0;
22265 + current->mm->end_code = 0;
22266 + current->mm->mmap = NULL;
22267 + current->flags &= ~PF_FORKNOEXEC;
22268 + current->mm->rss = 0;
22271 + * Construct the parameter and environment
22272 + * string table entries.
22274 + if ((status = setup_arg_pages(bprm, EXSTACK_DEFAULT)) < 0)
22277 + p = (u_long)coff_mktables((char *)bprm->p,
22278 + bprm->argc, bprm->envc);
22280 + current->mm->end_code = text.size +
22281 + (current->mm->start_code = text.vaddr);
22282 + current->mm->end_data = data.size +
22283 + (current->mm->start_data = data.vaddr);
22284 + current->mm->brk = bss.size +
22285 + (current->mm->start_brk = bss.vaddr);
22287 + current->mm->start_stack = p;
22288 + compute_creds(bprm);
22289 + start_thread(regs, start_addr, p);
22292 + old_fs = get_fs();
22293 + set_fs(get_ds());
22297 + * Read the file from disk...
22301 + loff_t pos = data.scnptr;
22302 + status = do_brk(text.vaddr, text.size);
22303 + bprm->file->f_op->read(bprm->file,
22304 + (char *)data.vaddr, data.scnptr, &pos);
22305 + status = do_brk(data.vaddr, data.size);
22306 + bprm->file->f_op->read(bprm->file,
22307 + (char *)text.vaddr, text.scnptr, &pos);
22310 + /* map the text pages...*/
22311 + status = map_coff(bprm->file, &text, PROT_READ | PROT_EXEC,
22312 + MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_EXECUTABLE,
22313 + text.scnptr & PAGE_MASK);
22315 + if (status != (text.vaddr & PAGE_MASK)) {
22316 + status = -ENOEXEC;
22317 + goto out_free_file;
22320 + /* map the data pages */
22321 + if (data.size != 0) {
22322 + status = map_coff(bprm->file, &data,
22323 + PROT_READ | PROT_WRITE | PROT_EXEC,
22324 + MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_EXECUTABLE,
22325 + data.scnptr & PAGE_MASK);
22327 + if (status != (data.vaddr & PAGE_MASK)) {
22328 + status = -ENOEXEC;
22329 + goto out_free_file;
22337 + * Construct the bss data for the process. The bss ranges from the
22338 + * end of the data (which may not be on a page boundary) to the end
22339 + * of the bss section. Allocate any necessary pages for the data.
22341 + if (bss.size != 0) {
22342 + down_write(¤t->mm->mmap_sem);
22343 + do_mmap(NULL, PAGE_ALIGN(bss.vaddr),
22344 + bss.size + bss.vaddr -
22345 + PAGE_ALIGN(bss.vaddr),
22346 + PROT_READ | PROT_WRITE | PROT_EXEC,
22347 + MAP_FIXED | MAP_PRIVATE, 0);
22348 + up_write(¤t->mm->mmap_sem);
22350 + if ((status = coff_clear_memory(bss.vaddr, bss.size)) < 0)
22351 + goto out_free_file;
22357 + goto out_free_file;
22360 + * Load any shared library for the executable.
22363 + status = coff_preload_shlibs(bprm, sect_bufr, sections);
22365 + set_binfmt(&coff_format);
22368 + * Generate any needed trap for this process. If an error occured then
22369 + * generate a segmentation violation. If the process is being debugged
22370 + * then generate the load trap. (Note: If this is a library load then
22371 + * do not generate the trap here. Pass the error to the caller who
22372 + * will do it for the process in the outer lay of this procedure call.)
22374 + if (status < 0) {
22376 + printk(KERN_WARNING "coff: trapping process with SEGV\n");
22377 + send_sig(SIGSEGV, current, 0); /* Generate the error trap */
22378 + } else if (current->ptrace & PT_PTRACED)
22379 + send_sig(SIGTRAP, current, 0);
22381 + /* We are committed. It can't fail */
22385 + sys_close(coff_exec_fileno);
22388 + kfree(sect_bufr);
22393 + * This procedure is called to load a library section. The various
22394 + * libraries are loaded from the list given in the section data.
22397 +coff_preload_shlib(struct linux_binprm *exe_bprm, COFF_SCNHDR *sect)
22399 + COFF_SLIBHD *phdr;
22405 + * Fetch the size of the section. There must be
22406 + * enough room for at least one entry.
22408 + nbytes = (long)COFF_LONG(sect->s_size);
22409 + if (nbytes < (long)COFF_SLIBSZ)
22412 + if (!(buffer = kmalloc(nbytes, GFP_KERNEL))) {
22413 + printk(KERN_WARNING "coff: unable to allocate shlib buffer\n");
22417 + err = kernel_read(exe_bprm->file,
22418 + COFF_LONG(sect->s_scnptr), buffer, nbytes);
22422 + if (err != nbytes)
22426 + * Go through the list of libraries in the data area.
22428 + phdr = (COFF_SLIBHD *)buffer;
22429 + while (nbytes > (long)COFF_SLIBSZ) {
22430 + int entry_size, header_size;
22431 + mm_segment_t old_fs = get_fs();
22433 + entry_size = COFF_LONG(phdr->sl_entsz) * sizeof(long);
22434 + header_size = COFF_LONG(phdr->sl_pathndx) * sizeof(long);
22437 + * Validate the sizes of the various items.
22438 + * I don't trust the linker!!
22440 + if ((u_int)header_size >= (u_int)nbytes)
22442 + if ((u_int)entry_size <= (u_int)header_size)
22444 + if (entry_size <= 0)
22447 + set_fs(get_ds());
22448 + err = sys_uselib(&((char *)phdr)[header_size]);
22455 + * Point to the next library in the section data.
22457 + nbytes -= entry_size;
22458 + phdr = (COFF_SLIBHD *) & ((char *) phdr)[entry_size];
22470 + * Find all library sections and preload the shared libraries.
22472 + * This will eventually recurse to our code and load the shared
22473 + * library with our own procedures.
22476 +coff_preload_shlibs(struct linux_binprm *bpp, COFF_SCNHDR *sp, int sections)
22481 + for (i = 0; i < sections; i++) {
22482 + flags = COFF_LONG(sp->s_flags);
22483 + if (flags == COFF_STYP_LIB) {
22484 + if ((err = coff_preload_shlib(bpp, sp)))
22487 + sp = (COFF_SCNHDR *)&((char *)sp)[COFF_SCNHSZ];
22494 + * Load the image for an (coff) binary.
22496 + * => this procedure is called by the main load sequence,
22497 + * it will load the executable and prepare it for execution
22500 +coff_load_binary(struct linux_binprm *bpp, struct pt_regs *rp)
22502 + return (coff_load_object(bpp, rp, 1));
22506 + * Load the image for a (coff) shared library.
22508 + * => this is called when we need to load a library based upon a file name.
22509 + * => also called through coff_preload_shlib
22512 +coff_load_shlib(struct file *fp)
22514 + struct linux_binprm *bpp;
22515 + struct pt_regs regs;
22516 + int err = -ENOMEM;
22518 + if (!(bpp = kmalloc(sizeof(struct linux_binprm), GFP_KERNEL))) {
22519 + printk(KERN_WARNING "coff: kmalloc failed\n");
22523 + memset(bpp, 0, sizeof(struct linux_binprm));
22526 + if ((err = kernel_read(fp, 0L, bpp->buf, sizeof(bpp->buf))) < 0)
22527 + printk(KERN_WARNING "coff: unable to read library header\n");
22529 + err = coff_load_object(bpp, ®s, 0);
22537 +coff_module_init(void)
22539 + return (register_binfmt(&coff_format));
22542 +static void __exit
22543 +coff_module_exit(void)
22545 + unregister_binfmt(&coff_format);
22548 +module_init(coff_module_init);
22549 +module_exit(coff_module_exit);
22550 diff -Nru linux-2.6.7/fs/binfmt_xout.c linux-2.6.7-abi/fs/binfmt_xout.c
22551 --- linux-2.6.7/fs/binfmt_xout.c 1970-01-01 01:00:00.000000000 +0100
22552 +++ linux-2.6.7-abi/fs/binfmt_xout.c 2004-07-22 17:44:21.000000000 +0200
22555 + * Copyright (c) 1994 Mike Jagdis (jaggy@purplet.demon.co.uk)
22556 + * Copyright (c) 2001 Christoph Hellwig (hch@caldera.de)
22562 + * This file is based upon code written by Al Longyear for the COFF file
22563 + * format which is in turn based upon code written by Eric Youngdale for
22564 + * the ELF object file format. Any errors are most likely my own however.
22566 +#include <linux/config.h>
22567 +#include <linux/module.h>
22568 +#include <linux/init.h>
22569 +#include <linux/fs.h>
22570 +#include <linux/sched.h>
22571 +#include <linux/mm.h>
22572 +#include <linux/mman.h>
22573 +#include <linux/a.out.h>
22574 +#include <linux/errno.h>
22575 +#include <linux/signal.h>
22576 +#include <linux/binfmts.h>
22577 +#include <linux/string.h>
22578 +#include <linux/fcntl.h>
22579 +#include <linux/ptrace.h>
22580 +#include <linux/personality.h>
22581 +#include <linux/file.h>
22582 +#include <linux/slab.h>
22583 +#define __KERNEL_SYSCALLS__
22584 +#include <linux/unistd.h>
22585 +#include <linux/syscalls.h>
22586 +#include <linux/xout.h>
22588 +#include <asm/uaccess.h>
22589 +#include <asm/desc.h>
22592 +MODULE_DESCRIPTION("Support for the Microsoft a.out (x.out) binary format");
22593 +MODULE_AUTHOR("Mike Jagdis, Christoph Hellwig");
22594 +MODULE_LICENSE("GPL");
22598 + * This is the name of the overlay library used for handling
22599 + * Xenix/286 binaries. Usually there is no need to change this.
22601 +#define _PATH_X286EMUL "/usr/lib/x286emul"
22604 + * If you compile with XOUT_DEBUG defined you will get additional
22605 + * debugging messages from the x.out module.
22610 + * If you compile with XOUT_SEGMENTS defined the loader will take care
22611 + * to set up the LDT as would "real" Xenix. This shouldn't be necessary
22612 + * for most programs but it is just possible that something out there
22613 + * makes assumptions about its environment and uses segment overrides.
22615 + * The default is not to bother setting up the LDT unless we need support
22616 + * for Xenix 286 binaries.
22618 +#undef XOUT_SEGMENTS
22621 + * Xenix 286 requires segment handling.
22623 +#if defined(CONFIG_BINFMT_XOUT_X286)
22624 +#define XOUT_SEGMENTS
22628 + * Be verbose if XOUT_DEBUG is defined.
22630 +#if defined(XOUT_DEBUG)
22631 +#define dprintk(x...) printk(x)
22633 +#define dprintk(x...)
22637 +static int xout_load_binary(struct linux_binprm *, struct pt_regs *);
22638 +static int xout_load_library(struct file *);
22640 +static struct linux_binfmt xout_format = {
22641 + NULL, THIS_MODULE, xout_load_binary, xout_load_library, NULL, PAGE_SIZE
22644 +#if defined(XOUT_DEBUG) && defined(XOUT_SEGMENTS)
22646 +static u_long __gdt[2];
22649 + * This is borrowed (with minor variations since we are in kernel mode)
22650 + * from the DPMI code for DOSEMU. I don't claim to understand LDTs :-).
22653 +print_desc(int which)
22655 + u_long base_addr, limit;
22657 + int count, type, dpl, i;
22660 + lp = (u_long *)((struct desc_struct*)
22661 + (current->mm->context.segments));
22662 + count = LDT_ENTRIES;
22663 + printk(KERN_DEBUG "xout: LDT\n");
22665 + /* joerg from david bruce */
22666 + asm volatile ("sgdt __gdt+2");
22667 + lp = (u_long *)__gdt[1];
22669 + printk(KERN_DEBUG "xout: GDT\n");
22675 + printk(KERN_DEBUG "XOUT: SLOT BASE/SEL LIM/OFF TYPE DPL ACCESSBITS\n");
22676 + for (i=0; i < count; i++, lp++) {
22677 + /* First 32 bits of descriptor */
22678 + base_addr = (*lp >> 16) & 0x0000FFFF;
22679 + limit = *lp & 0x0000FFFF;
22682 + /* First 32 bits of descriptor */
22683 + base_addr |= (*lp & 0xFF000000) | ((*lp << 16) & 0x00FF0000);
22684 + limit |= (*lp & 0x000F0000);
22685 + type = (*lp >> 10) & 7;
22686 + dpl = (*lp >> 13) & 3;
22687 + if ((base_addr > 0) || (limit > 0 )) {
22688 + printk(KERN_DEBUG "XOUT: %03d 0x%08lx 0x%08lx 0x%02x %03d %s%s%s%s%s%s%s\n",
22690 + base_addr, limit, type, dpl,
22691 + (*lp & 0x100) ? " ACCS'D" : "",
22692 + (*lp & 0x200) ? " R&W" : " R&X",
22693 + (*lp & 0x8000) ? " PRESENT" : "",
22694 + (*lp & 0x100000) ? " USER" : "",
22695 + (*lp & 0x200000) ? " X" : "",
22696 + (*lp & 0x400000) ? " 32" : "",
22697 + (*lp & 0x800000) ? " PAGES" : "");
22705 +xout_create_tables(char *p, struct linux_binprm *bprm, int ibcs)
22707 + int argc = bprm->argc, envc = bprm->envc;
22708 + u_long *argv,*envp;
22711 + sp = (u_long *) ((-(u_long)sizeof(char *)) & (u_long) p);
22718 + put_user(envp, sp);
22720 + put_user(argv, sp);
22723 + put_user(argc, sp);
22724 + current->mm->arg_start = (u_long) p;
22725 + while (argc-->0) {
22726 + put_user(p, argv); argv++;
22727 + p += strlen_user(p);
22729 + put_user(NULL,argv);
22730 + current->mm->arg_end = current->mm->env_start = (u_long) p;
22731 + while (envc-->0) {
22732 + put_user(p, envp); envp++;
22733 + p += strlen_user(p);
22735 + put_user(NULL,envp);
22736 + current->mm->env_end = (u_long) p;
22740 +static __inline int
22741 +isnotaligned(struct xseg *seg)
22743 + dprintk(KERN_DEBUG
22744 + "xout: %04x %04x %04x %02x %08lx %08lx %08lx %08lx\n",
22745 + seg->xs_type, seg->xs_attr, seg->xs_seg, seg->xs_align,
22746 + seg->xs_filpos, seg->xs_psize, seg->xs_vsize, seg->xs_rbase);
22748 +#if defined(XOUT_DEBUG)
22749 + if ((seg->xs_filpos - seg->xs_rbase) & ~PAGE_MASK) {
22750 + printk(KERN_DEBUG
22751 + "xout: bad alignment - demand paging disabled\n");
22754 + return ((seg->xs_filpos & ~PAGE_MASK) | (seg->xs_rbase & ~PAGE_MASK));
22757 +static __inline__ void
22758 +clear_memory(u_long addr, u_long size)
22760 + while (size-- != 0)
22761 + put_user(0, (char *)addr++);
22764 +#if defined(XOUT_SEGMENTS)
22765 +#if defined(CONFIG_X86)
22766 +/* from linux-2.4.25/include/asm-i386/ldt.h */
22767 +struct modify_ldt_ldt_s {
22768 + unsigned int entry_number;
22769 + unsigned long base_addr;
22770 + unsigned int limit;
22771 + unsigned int seg_32bit:1;
22772 + unsigned int contents:2;
22773 + unsigned int read_exec_only:1;
22774 + unsigned int limit_in_pages:1;
22775 + unsigned int seg_not_present:1;
22776 + unsigned int useable:1;
22782 +xout_amen(struct file *fp, struct xseg *sp, int pageable, u_long *addrp,
22783 + struct xexec *xexec, struct pt_regs *regs, int impure)
22785 +#if defined(XOUT_SEGMENTS)
22786 + struct xext *xext = (struct xext *)(xexec + 1);
22787 + struct desc_struct def_ldt;
22788 + struct modify_ldt_ldt_s ldt_info;
22789 + mm_segment_t old_fs;
22790 + u_long mirror_addr = 0;
22793 + u_long bss_size, bss_base;
22796 +#if defined(XOUT_SEGMENTS)
22797 + old_fs = get_fs();
22803 + * Xenix 386 segments simply map the whole address
22804 + * space either read-exec only or read-write.
22806 + ldt_info.entry_number = sp->xs_seg >> 3;
22807 + ldt_info.read_exec_only = 0 /* ((s->xs_attr & XS_APURE) ? 1 : 0) */;
22808 + ldt_info.contents = ((sp->xs_type == XS_TTEXT) ? 2 : 0);
22809 + ldt_info.seg_not_present = 0;
22810 + ldt_info.seg_32bit = ((sp->xs_attr & XS_A32BIT) ? 1 : 0);
22811 + if (!ldt_info.seg_32bit) {
22812 + ldt_info.base_addr = *addrp;
22813 + *addrp = PAGE_ALIGN(*addrp + sp->xs_vsize);
22814 + sp->xs_rbase = ldt_info.base_addr;
22816 + ldt_info.base_addr = 0;
22819 + bss_size = sp->xs_vsize - sp->xs_psize;
22820 + bss_base = sp->xs_rbase + sp->xs_psize;
22823 + * If it is a text segment update the code boundary
22824 + * markers. If it is a data segment update the data
22825 + * boundary markers.
22827 + if (sp->xs_type == XS_TTEXT) {
22828 + if ((sp->xs_rbase + sp->xs_psize) > current->mm->end_code)
22829 + current->mm->end_code = (sp->xs_rbase + sp->xs_psize);
22830 + } else if (sp->xs_type == XS_TDATA) {
22831 +#if defined(XOUT_SEGMENTS)
22833 + * If it is the first data segment note that
22834 + * this is the segment we start in. If this
22835 + * isn't a 386 binary add the stack to the
22836 + * top of this segment.
22838 + if ((xexec->x_cpu & XC_CPU) != XC_386) {
22839 + if (regs->ebx == regs->ecx) {
22840 + regs->ecx = sp->xs_seg;
22841 + regs->edx = sp->xs_vsize;
22842 + sp->xs_vsize = 0x10000;
22843 + *addrp = PAGE_ALIGN(ldt_info.base_addr + sp->xs_vsize);
22846 + if (regs->xds == regs->xcs)
22847 + regs->xds = regs->xes = regs->xss = sp->xs_seg;
22850 + if ((sp->xs_rbase + sp->xs_psize) > current->mm->end_data)
22851 + current->mm->end_data = (sp->xs_rbase + sp->xs_psize);
22854 + if ((sp->xs_rbase + sp->xs_vsize) > current->mm->brk) {
22855 + current->mm->start_brk =
22856 + current->mm->brk = PAGE_ALIGN(sp->xs_rbase + sp->xs_vsize);
22859 +#if defined(XOUT_SEGMENTS)
22860 + if (ldt_info.seg_32bit) {
22861 + ldt_info.limit = (TASK_SIZE-1) >> 12;
22862 + ldt_info.limit_in_pages = 1;
22864 + ldt_info.limit = sp->xs_vsize-1;
22865 + ldt_info.limit_in_pages = 0;
22868 + dprintk(KERN_DEBUG "xout: ldt %02x, type=%d, base=0x%08lx, "
22869 + "limit=0x%08x, pages=%d, 32bit=%d\n",
22870 + ldt_info.entry_number, ldt_info.contents,
22871 + ldt_info.base_addr, ldt_info.limit,
22872 + ldt_info.limit_in_pages, ldt_info.seg_32bit);
22875 + * Use the modify_ldt syscall since this allocates
22876 + * the initial space for the LDT table, tweaks the
22877 + * GDT etc. We need to read the current LDT first
22878 + * since we need to copy the lcall7 call gate.
22880 + set_fs(get_ds());
22881 + if (!current->mm->context.size) {
22882 + sys_modify_ldt(2, &def_ldt, sizeof(def_ldt));
22884 + dprintk(KERN_DEBUG
22885 + "x.out: def_ldt.a 0x%08lx, def_ldt.b 0x%08lx\n",
22886 + def_ldt.a, def_ldt.b);
22891 + err = sys_modify_ldt(1, &ldt_info, sizeof(ldt_info));
22893 + if (status >= 0 && !ntext && s->xs_seg == 0x47) {
22894 + /* Uh oh, impure binary... */
22895 + ldt_info.entry_number = 0x3f >> 3;
22897 + ldt_info.read_exec_only = 1;
22899 + ldt_info.read_exec_only = 0;
22901 + ldt_info.contents = 2;
22902 + status = sys_modify_ldt)(1, &ldt_info, sizeof(ldt_info));
22907 + struct desc_struct *ldt;
22909 + ldt = (struct desc_struct *)current->mm->context.ldt;
22910 + ldt->a = def_ldt.a;
22911 + ldt->b = def_ldt.b;
22916 + printk(KERN_INFO "xout: modify_ldt returned %d\n", err);
22923 + dprintk(KERN_DEBUG "xout: Null map 0x%08lx, length 0x%08lx\n",
22924 + sp->xs_rbase, sp->xs_vsize);
22925 + down_write(¤t->mm->mmap_sem);
22926 + err = do_mmap(NULL, sp->xs_rbase, sp->xs_vsize,
22927 + PROT_READ|PROT_WRITE|PROT_EXEC,
22928 + MAP_FIXED|MAP_PRIVATE, 0);
22929 + up_write(¤t->mm->mmap_sem);
22933 + dprintk(KERN_DEBUG "xout: mmap to 0x%08lx from 0x%08lx, length 0x%08lx\n",
22934 + sp->xs_rbase, sp->xs_filpos, sp->xs_psize);
22935 + if (sp->xs_attr & XS_APURE) {
22936 + down_write(¤t->mm->mmap_sem);
22937 + err = do_mmap(fp, sp->xs_rbase, sp->xs_psize,
22938 + PROT_READ|PROT_EXEC, MAP_FIXED|MAP_SHARED,
22940 + up_write(¤t->mm->mmap_sem);
22942 + down_write(¤t->mm->mmap_sem);
22943 + err = do_mmap(fp, sp->xs_rbase, sp->xs_psize,
22944 + PROT_READ|PROT_WRITE|PROT_EXEC,
22945 + MAP_FIXED|MAP_PRIVATE | MAP_DENYWRITE | MAP_EXECUTABLE,
22947 + up_write(¤t->mm->mmap_sem);
22950 + if (err > TASK_SIZE || err < 0)
22954 + * Map uninitialised data.
22957 + if (bss_base & PAGE_MASK) {
22958 + clear_memory(bss_base, PAGE_ALIGN(bss_base)-bss_base);
22959 + bss_size -= (PAGE_ALIGN(bss_base) - bss_base);
22960 + bss_base = PAGE_ALIGN(bss_base);
22963 + dprintk(KERN_DEBUG "xout: Null map 0x%08lx, length 0x%08lx\n",
22964 + bss_base, bss_size);
22966 + down_write(¤t->mm->mmap_sem);
22967 + err = do_mmap(NULL, bss_base, bss_size,
22968 + PROT_READ | PROT_WRITE | PROT_EXEC,
22969 + MAP_FIXED | MAP_PRIVATE, 0);
22970 + up_write(¤t->mm->mmap_sem);
22974 + if (err > TASK_SIZE)
22976 +#if defined(XOUT_SEGMENTS)
22977 + if (err >= 0 && impure && sp->xs_seg >= 0x47) {
22979 + * Uh oh, impure binary.
22980 + * Mirror this data segment to the text segment
22982 + *addrp = mirror_addr = sp->xs_rbase;
22983 + sp->xs_seg = xext->xe_eseg;
22984 + sp->xs_type = XS_TTEXT;
22992 + * Helper function to process the load operation.
22995 +xout_load_object(struct linux_binprm * bpp, struct pt_regs *rp, int executable)
22997 + struct xexec *xexec = (struct xexec *)bpp->buf;
22998 + struct xext *xext = (struct xext *)(xexec + 1);
22999 + struct xseg *seglist;
23000 + struct file *fp = NULL;
23002 + int nsegs, ntext, ndata;
23003 + int pageable = 1, err = 0;
23006 + dprintk(KERN_DEBUG "xout: binfmt_xout entry: %s\n",
23007 + bpp->file->f_dentry->d_name.name);
23009 + if (xexec->x_magic != X_MAGIC) {
23010 + dprintk(KERN_DEBUG "xout: bad magic %04x\n", xexec->x_magic);
23014 + switch (xexec->x_cpu & XC_CPU) {
23017 +#if defined(CONFIG_BINFMT_XOUT_X286)
23025 + dprintk(KERN_DEBUG "xout: unsupported CPU type (%02x)\n",
23031 + * We can't handle byte or word swapped headers. Well, we
23032 + * *could* but they should never happen surely?
23034 + if ((xexec->x_cpu & (XC_BSWAP | XC_WSWAP)) != XC_WSWAP) {
23035 + dprintk(KERN_DEBUG "xout: wrong byte or word sex (%02x)\n",
23040 + /* Check it's an executable. */
23041 + if (!(xexec->x_renv & XE_EXEC)) {
23042 + dprintk(KERN_DEBUG "xout: not executable\n");
23047 + * There should be an extended header and there should be
23048 + * some segments. At this stage we don't handle non-segmented
23049 + * binaries. I'm not sure you can get them under Xenix anyway.
23051 + if (xexec->x_ext != sizeof(struct xext)) {
23052 + dprintk(KERN_DEBUG "xout: bad extended header\n");
23056 + if (!(xexec->x_renv & XE_SEG) || !xext->xe_segsize) {
23057 + dprintk(KERN_DEBUG "xout: not segmented\n");
23061 + if (!(seglist = kmalloc(xext->xe_segsize, GFP_KERNEL))) {
23062 + printk(KERN_WARNING "xout: allocating segment list failed\n");
23066 + err = kernel_read(bpp->file, xext->xe_segpos,
23067 + (char *)seglist, xext->xe_segsize);
23069 + dprintk(KERN_DEBUG "xout: problem reading segment table\n");
23073 + if (!bpp->file->f_op->mmap)
23076 + nsegs = xext->xe_segsize / sizeof(struct xseg);
23078 + ntext = ndata = 0;
23079 + for (i = 0; i < nsegs; i++) {
23080 + switch (seglist[i].xs_type) {
23082 + if (isnotaligned(seglist+i))
23087 + if (isnotaligned(seglist+i))
23098 + * Generate the proper values for the text fields
23100 + * THIS IS THE POINT OF NO RETURN. THE NEW PROCESS WILL TRAP OUT SHOULD
23101 + * SOMETHING FAIL IN THE LOAD SEQUENCE FROM THIS POINT ONWARD.
23105 + * Flush the executable from memory. At this point the executable is
23106 + * committed to being defined or a segmentation violation will occur.
23108 + if (executable) {
23109 + dprintk(KERN_DEBUG "xout: flushing executable\n");
23111 + flush_old_exec(bpp);
23113 + current->mm->mmap = NULL;
23114 + current->mm->rss = 0;
23116 + if ((err = setup_arg_pages(bpp, EXSTACK_DEFAULT)) < 0) {
23117 + send_sig(SIGSEGV, current, 1);
23121 + bpp->p = (u_long)xout_create_tables((char *)bpp->p, bpp,
23122 + (xexec->x_cpu & XC_CPU) == XC_386 ? 1 : 0);
23124 +#if defined(XOUT_SEGMENTS)
23126 + * These will be set up later once we've seen the
23127 + * segments that make the program up.
23129 + current->mm->start_code = 0;
23130 + current->mm->start_data = 0;
23131 + current->mm->end_code = 0;
23132 + current->mm->end_data = 0;
23133 + current->mm->start_brk = 0;
23134 + current->mm->brk = 0;
23136 + compute_creds(bpp);
23137 + current->flags &= ~PF_FORKNOEXEC;
23140 + * The code selector is advertised in the header.
23142 + if ((xexec->x_cpu & XC_CPU) != XC_386) {
23143 + rp->ebx = rp->ecx = xext->xe_eseg;
23144 + rp->eax = xexec->x_entry;
23146 + rp->xcs = rp->xds = rp->xes = rp->xss = xext->xe_eseg;
23147 + rp->eip = xexec->x_entry;
23149 +#else /* XOUT_SEGMENTS */
23150 + current->mm->start_code = 0;
23151 + current->mm->end_code = xexec->x_text;
23152 + current->mm->end_data = xexec->x_text + xexec->x_data;
23153 + current->mm->start_brk =
23154 + current->mm->brk = xexec->x_text + xexec->x_data + xexec->x_bss;
23156 + compute_creds(bpp);
23157 + current->flags &= ~PF_FORKNOEXEC;
23159 + rp->xcs = __USER_CS;
23160 + rp->xds = rp->xes = rp->xss = __USER_DS;
23161 + rp->eip = xexec->x_entry;
23162 +#endif /* XOUT_SEGMENTS */
23164 + dprintk(KERN_DEBUG "xout: entry point = 0x%x:0x%08lx\n",
23165 + xext->xe_eseg, xexec->x_entry);
23167 + rp->esp = current->mm->start_stack = bpp->p;
23169 + set_personality(PER_XENIX);
23173 + * Base address for mapping 16bit segments. This should lie above
23174 + * the emulator overlay.
23176 + addr = X286_MAP_ADDR;
23178 +#if defined(CONFIG_BINFMT_XOUT_X286)
23180 + * If this isn't a 386 executable we need to load the overlay
23181 + * library to emulate a [2]86 environment and save the binary
23182 + * headers for later reference by the emulator.
23184 + if ((xexec->x_cpu & XC_CPU) != XC_386) {
23185 + mm_segment_t fs = get_fs();
23187 + set_fs(get_ds());
23188 + err = sys_uselib(_PATH_X286EMUL);
23192 + "xout: loading of %s failed with error %d\n",
23193 + _PATH_X286EMUL, err);
23197 + down_write(¤t->mm->mmap_sem);
23198 + err = do_mmap(NULL,
23199 + addr, sizeof(struct xexec)+sizeof(struct xext),
23200 + PROT_READ|PROT_WRITE|PROT_EXEC,
23201 + MAP_FIXED|MAP_PRIVATE,
23203 + up_write(¤t->mm->mmap_sem);
23205 + if (err > TASK_SIZE)
23208 + copy_to_user((char *)addr, xexec, sizeof(struct xexec));
23209 + copy_to_user((char *)addr+sizeof(struct xexec), xext, sizeof(struct xext));
23210 + addr = PAGE_ALIGN(addr+sizeof(struct xexec)+sizeof(struct xext));
23216 + * Scan the segments and map them into the process space. If this
23217 + * executable is pageable (unlikely since Xenix aligns to 1k
23218 + * boundaries and we want it aligned to 4k boundaries) this is
23219 + * all we need to do. If it isn't pageable we go round again
23220 + * afterwards and load the data. We have to do this in two steps
23221 + * because if segments overlap within a 4K page we'll lose the
23222 + * first instance when we remap the page. Hope that's clear...
23224 + for (i = 0; err >= 0 && i < nsegs; i++) {
23225 + struct xseg *sp = seglist+i;
23227 + if (sp->xs_attr & XS_AMEM) {
23228 + err = xout_amen(fp, sp, pageable, &addr,
23229 + xexec, rp, (!ntext && ndata == 1));
23235 + * We better fix start_data because sys_brk looks there to
23236 + * calculate data size.
23237 + * Kernel 2.2 did look at end_code so this is reasonable.
23239 + if (current->mm->start_data == current->mm->start_code)
23240 + current->mm->start_data = current->mm->end_code;
23242 + dprintk(KERN_DEBUG "xout: start code 0x%08lx, end code 0x%08lx,"
23243 + " start data 0x%08lx, end data 0x%08lx, brk 0x%08lx\n",
23244 + current->mm->start_code, current->mm->end_code,
23245 + current->mm->start_data, current->mm->end_data,
23246 + current->mm->brk);
23248 +#if defined(XOUT_DEBUG) && defined(XOUT_SEGMENTS)
23258 + for (i = 0; (err >= 0) && (i < nsegs); i++) {
23259 + struct xseg *sp = seglist + i;
23262 + if (sp->xs_type == XS_TTEXT || sp->xs_type == XS_TDATA) {
23263 + dprintk(KERN_DEBUG "xout: read to 0x%08lx from 0x%08lx,"
23264 + " length 0x%08lx\n", sp->xs_rbase,
23265 + sp->xs_filpos, sp->xs_psize);
23267 + if (sp->xs_psize < 0)
23271 + * Do we still get the size ? Yes! [joerg]
23273 + psize = kernel_read(bpp->file, sp->xs_filpos,
23274 + (char *)sp->xs_rbase, sp->xs_psize);
23276 + if (psize != sp->xs_psize) {
23277 + dprintk(KERN_DEBUG "xout: short read\n");
23285 + * Generate any needed trap for this process. If an error occured then
23286 + * generate a segmentation violation. If the process is being debugged
23287 + * then generate the load trap. (Note: If this is a library load then
23288 + * do not generate the trap here. Pass the error to the caller who
23289 + * will do it for the process in the outer lay of this procedure call.)
23292 + if (executable) {
23294 + dprintk(KERN_DEBUG "xout: loader forces seg fault "
23295 + "(err = %d)\n", err);
23296 + send_sig(SIGSEGV, current, 0);
23297 + } else if (current->ptrace & PT_PTRACED)
23298 + send_sig(SIGTRAP, current, 0);
23305 + dprintk(KERN_DEBUG "xout: binfmt_xout: result = %d\n", err);
23308 + * If we are using the [2]86 emulation overlay we enter this
23309 + * rather than the real program and give it the information
23310 + * it needs to start the ball rolling.
23312 + if ((xexec->x_cpu & XC_CPU) != XC_386) {
23314 + regs->eax = regs->eip;
23315 + regs->ebx = regs->xcs;
23316 + regs->ecx = regs->xds;
23317 + regs->xcs = __USER_CS;
23318 + regs->xds = regs->xes = regs->xss = __USER_DS;
23320 + rp->eip = 0x1020;
23321 + dprintk(KERN_DEBUG "xout: x286emul 0x%02lx:0x%04lx,"
23322 + " ds=0x%02lx, stack 0x%02lx:0x%04lx\n",
23323 + rp->ebx, rp->eax, rp->ecx, rp->ecx,
23326 + while (!signal_pending(current))
23329 + return (err < 0 ? err : rp->eax);
23333 + while (!signal_pending(current))
23337 + * Xenix 386 programs expect the initial brk value to be in eax
23338 + * on start up. Hence if we succeeded we need to pass back
23339 + * the brk value rather than the status. Ultimately the
23340 + * ret_from_sys_call assembly will place this in eax before
23341 + * resuming (starting) the process.
23343 + return (err < 0 ? err : current->mm->brk);
23351 + * This procedure is called by the main load sequence. It will load
23352 + * the executable and prepare it for execution. It provides the additional
23353 + * parameters used by the recursive xout loader and tells the loader that
23354 + * this is the main executable. How simple it is . . . .
23357 +xout_load_binary(struct linux_binprm *bpp, struct pt_regs *rp)
23359 + return (xout_load_object(bpp, rp, 1));
23363 + * Load the image for any shared library. This is called when
23364 + * we need to load a library based upon a file name.
23366 + * XXX: I have never seen a Xenix shared library... --hch
23369 +xout_load_library(struct file *fp)
23371 + struct linux_binprm *bpp;
23372 + struct pt_regs regs;
23373 + int err = -ENOMEM;
23375 + if (!(bpp = kmalloc(sizeof(struct linux_binprm), GFP_KERNEL))) {
23376 + printk(KERN_WARNING "xout: kmalloc failed\n");
23380 + memset(bpp, 0, sizeof(struct linux_binprm));
23383 + if ((err = kernel_read(fp, 0L, bpp->buf, sizeof(bpp->buf))) < 0)
23384 + printk(KERN_WARNING "xout: unable to read library header\n");
23386 + err = xout_load_object(bpp, ®s, 0);
23394 +binfmt_xout_init(void)
23396 + return register_binfmt(&xout_format);
23399 +static void __exit
23400 +binfmt_xout_exit(void)
23402 + unregister_binfmt(&xout_format);
23405 +module_init(binfmt_xout_init);
23406 +module_exit(binfmt_xout_exit);
23407 diff -Nru linux-2.6.7/fs/Kconfig.binfmt linux-2.6.7-abi/fs/Kconfig.binfmt
23408 --- linux-2.6.7/fs/Kconfig.binfmt 2004-06-16 07:20:03.000000000 +0200
23409 +++ linux-2.6.7-abi/fs/Kconfig.binfmt 2004-07-22 17:44:21.000000000 +0200
23410 @@ -119,3 +119,5 @@
23411 You may say M here for module support and later load the module when
23412 you have use for it; the module is called binfmt_misc. If you
23413 don't know what to answer at this point, say Y.
23415 +source "abi/Kconfig"
23416 diff -Nru linux-2.6.7/fs/Makefile linux-2.6.7-abi/fs/Makefile
23417 --- linux-2.6.7/fs/Makefile 2004-06-16 07:19:36.000000000 +0200
23418 +++ linux-2.6.7-abi/fs/Makefile 2004-07-22 17:44:21.000000000 +0200
23420 obj-y += $(nfsd-y) $(nfsd-m)
23422 obj-$(CONFIG_BINFMT_AOUT) += binfmt_aout.o
23423 +obj-$(CONFIG_BINFMT_XOUT) += binfmt_xout.o
23424 +obj-$(CONFIG_BINFMT_COFF) += binfmt_coff.o
23425 obj-$(CONFIG_BINFMT_EM86) += binfmt_em86.o
23426 obj-$(CONFIG_BINFMT_MISC) += binfmt_misc.o
23428 diff -Nru linux-2.6.7/fs/pipe.c linux-2.6.7-abi/fs/pipe.c
23429 --- linux-2.6.7/fs/pipe.c 2004-06-16 07:19:35.000000000 +0200
23430 +++ linux-2.6.7-abi/fs/pipe.c 2004-07-22 17:44:21.000000000 +0200
23431 @@ -728,3 +728,9 @@
23433 module_init(init_pipe_fs)
23434 module_exit(exit_pipe_fs)
23436 +/* symbol exports for LinuxABI Sytem V R4 support */
23437 +/* for ease of use we are exporting those needed symbols permanently */
23438 +/* #if CONFIG_ABI_SVR4 == m */
23439 +EXPORT_SYMBOL(do_pipe);
23441 diff -Nru linux-2.6.7/fs/readdir.c linux-2.6.7-abi/fs/readdir.c
23442 --- linux-2.6.7/fs/readdir.c 2004-06-16 07:19:22.000000000 +0200
23443 +++ linux-2.6.7-abi/fs/readdir.c 2004-07-22 17:44:21.000000000 +0200
23446 #ifdef __ARCH_WANT_OLD_READDIR
23448 -struct old_linux_dirent {
23449 - unsigned long d_ino;
23450 - unsigned long d_offset;
23451 - unsigned short d_namlen;
23455 struct readdir_callback {
23456 struct old_linux_dirent __user * dirent;
23458 diff -Nru linux-2.6.7/include/abi/cxenix/signal.h linux-2.6.7-abi/include/abi/cxenix/signal.h
23459 --- linux-2.6.7/include/abi/cxenix/signal.h 1970-01-01 01:00:00.000000000 +0100
23460 +++ linux-2.6.7-abi/include/abi/cxenix/signal.h 2004-07-22 17:44:21.000000000 +0200
23462 +#ifndef _ABI_CXENIX_SIGNAL_H
23463 +#define _ABI_CXENIX_SIGNAL_H
23466 + SCO_SA_NOCLDSTOP = 0x001,
23467 + SCO_SA_COMPAT = 0x080, /* 3.2.2 compatibilty. */
23468 + SCO_SA_SIGNAL = 0x100,
23471 +struct sco_sigaction {
23472 + void (*sa_handler)(int);
23473 + unsigned long sa_mask;
23477 +#endif /* _ABI_CXENIX_SIGNAL_H */
23478 diff -Nru linux-2.6.7/include/abi/cxenix/sysent.h linux-2.6.7-abi/include/abi/cxenix/sysent.h
23479 --- linux-2.6.7/include/abi/cxenix/sysent.h 1970-01-01 01:00:00.000000000 +0100
23480 +++ linux-2.6.7-abi/include/abi/cxenix/sysent.h 2004-07-22 17:44:21.000000000 +0200
23483 + * include/abi/xnx.h -- xenix ibcs interface
23485 + * Copyright (C) 1993 Drew Sullivan
23486 + * Released for general use as long as this copyright remains.
23491 +struct sco_sigaction;
23494 +typedef unsigned short excode_t;
23496 +extern int xnx_locking(int fd, int mode, unsigned long size);
23497 +extern int xnx_creatsem(char *sem_name, int mode);
23498 +extern int xnx_opensem(char *sem_name);
23499 +extern int xnx_sigsem(int sem_num);
23500 +extern int xnx_waitsem(int sem_num);
23501 +extern int xnx_nbwaitsem(int sem_num);
23502 +extern int xnx_rdchk(int fd);
23503 +extern int xnx_ftime(struct timeb * tp);
23504 +extern int xnx_nap(long period);
23505 +extern int xnx_sdget(char *path, int flags, long size, int mode);
23506 +extern int xnx_sdfree(char* addr);
23507 +extern int xnx_sdenter(char *addr, int flags);
23508 +extern int xnx_sdleave(char *addr);
23509 +extern int xnx_sdgetv(char *addr);
23510 +extern int xnx_sdwaitv(char *addr, int vnum);
23511 +extern int xnx_proctl(int pid, int command, char *arg);
23512 +extern int xnx_execseg(excode_t oldaddr, unsigned size);
23513 +extern int xnx_unexecseg(excode_t addr);
23514 +extern int xnx_eaccess(char *path, int mode);
23515 +extern int xnx_paccess(int pid, int cmd, int offset, int count, char *ptr);
23516 +extern int xnx_sigpending(unsigned long *set);
23517 +extern int xnx_pathconf(char *path, int name);
23518 +extern int xnx_fpathconf(int fildes, int name);
23521 +extern int xnx_sigaction(int, const struct sco_sigaction *,
23522 + struct sco_sigaction *);
23525 +extern int xnx_utsname(u_long addr);
23528 +extern void cxenix(struct pt_regs *);
23529 diff -Nru linux-2.6.7/include/abi/ioctl.h linux-2.6.7-abi/include/abi/ioctl.h
23530 --- linux-2.6.7/include/abi/ioctl.h 1970-01-01 01:00:00.000000000 +0100
23531 +++ linux-2.6.7-abi/include/abi/ioctl.h 2004-07-22 17:44:21.000000000 +0200
23534 + * Copyright (C) 1994 Mike Jagdis (jaggy@purplet.demon.co.uk)
23535 + * Copyright (C) 2001 Caldera Deutschland GmbH
23537 +#ifndef _ABI_IOCTL_H
23538 +#define _ABI_IOCTL_H
23543 + * Ioctl's have the command encoded in the lower word, and the size of
23544 + * any in or out parameters in the upper word. The high 3 bits of the
23545 + * upper word are used to encode the in/out status of the parameter.
23547 + * Note that Linux does the same but has the IOC_IN and IOC_OUT values
23548 + * round the other way and uses 0 for IOC_VOID.
23551 + /* parameter length, at most 13 bits */
23552 + BSD_IOCPARM_MASK = 0x1fff,
23553 + /* no parameters */
23554 + BSD_IOC_VOID = 0x20000000,
23555 + /* copy out parameters */
23556 + BSD_IOC_OUT = 0x40000000,
23557 + /* copy in parameters */
23558 + BSD_IOC_IN = 0x80000000,
23559 + /* possibly copy in and out parameters */
23560 + BSD_IOC_INOUT = BSD_IOC_IN|BSD_IOC_OUT,
23564 +#define BSD__IOC(inout,group,num,len) \
23565 + (inout | ((len & BSD_IOCPARM_MASK) << 16) | ((group) << 8) | (num))
23567 +#define BSD__IO(g,n) BSD__IOC(BSD_IOC_VOID, (g), (n), 0)
23568 +#define BSD__IOR(g,n,t) BSD__IOC(BSD_IOC_OUT, (g), (n), sizeof(t))
23569 +#define BSD__IOW(g,n,t) BSD__IOC(BSD_IOC_IN, (g), (n), sizeof(t))
23570 +#define BSD__IOWR(g,n,t) BSD__IOC(BSD_IOC_INOUT, (g), (n), sizeof(t))
23572 +/* Some SYSV systems exhibit "compatible" BSD ioctls without the bumf. */
23573 +#define BSD__IOV(c,d) (((c) << 8) | (d))
23575 +#endif /* _ABI_IOCTL_H */
23576 diff -Nru linux-2.6.7/include/abi/sco/ioctl.h linux-2.6.7-abi/include/abi/sco/ioctl.h
23577 --- linux-2.6.7/include/abi/sco/ioctl.h 1970-01-01 01:00:00.000000000 +0100
23578 +++ linux-2.6.7-abi/include/abi/sco/ioctl.h 2004-07-22 17:44:21.000000000 +0200
23580 +#ifndef _ABI_SCO_IOCTL_H
23581 +#define _ABI_SCO_IOCTL_H
23584 +extern int sco_tape_ioctl(int, u_int, caddr_t);
23587 +extern int sco_term_ioctl(int, u_int, caddr_t);
23590 +extern int sco_vtkbd_ioctl(int, u_int, caddr_t);
23592 +#endif /* _ABI_SCO_IOCTL_H */
23593 diff -Nru linux-2.6.7/include/abi/sco/mman.h linux-2.6.7-abi/include/abi/sco/mman.h
23594 --- linux-2.6.7/include/abi/sco/mman.h 1970-01-01 01:00:00.000000000 +0100
23595 +++ linux-2.6.7-abi/include/abi/sco/mman.h 2004-07-22 17:44:21.000000000 +0200
23598 + * Copyright (c) 2001 Caldera Deutschland GmbH.
23599 + * All rights reserved.
23601 + * This program is free software; you can redistribute it and/or modify
23602 + * it under the terms of the GNU General Public License as published by
23603 + * the Free Software Foundation; either version 2 of the License, or
23604 + * (at your option) any later version.
23606 + * This program is distributed in the hope that it will be useful,
23607 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
23608 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23609 + * GNU General Public License for more details.
23611 + * You should have received a copy of the GNU General Public License
23612 + * along with this program; if not, write to the Free Software
23613 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23615 +#ifndef _ABI_SCO_MMAN_H
23616 +#define _ABI_SCO_MMAN_H
23621 + * SCO OpenServer memory mapped files declarations
23624 +#define SCO_MAP_FAILED ((void *)-1)
23626 +/* protections flags for mmap() and mprotect() */
23627 +#define SCO_PROT_NONE 0x0000
23628 +#define SCO_PROT_READ 0x0001
23629 +#define SCO_PROT_WRITE 0x0002
23630 +#define SCO_PROT_EXEC 0x0004
23632 +/* sharing types for mmap() */
23633 +#define SCO_MAP_SHARED 0x0001
23634 +#define SCO_MAP_PRIVATE 0x0002
23635 +#define SCO_MAP_FIXED 0x0010
23636 +#define SCO_MAP_PHMEM 0x1000
23637 +#define SCO_MAP_KVMEM 0x2000
23638 +#define SCO_MAP_ANCESTRAL 0x4000
23639 +#define SCO_MAP_NOEOF 0x8000
23641 +#define SCO_MAP_UNIMPL \
23642 + (SCO_MAP_PHMEM|SCO_MAP_KVMEM|SCO_MAP_ANCESTRAL|SCO_MAP_NOEOF)
23644 +/* memcntl() subfunctions */
23645 +#define SCO_MC_SYNC 0x0001
23646 +#define SCO_MC_LOCK 0x0002
23647 +#define SCO_MC_UNLOCK 0x0003
23648 +#define SCO_MC_LOCKAS 0x0005
23649 +#define SCO_MC_UNLOCKAS 0x0006
23650 +#define SCO_MC_MAPCPU 0x8000
23651 +#define SCO_MC_MAPUBLK 0x8001
23653 +/* msync() flags */
23654 +#define SCO_MS_SYNC 0x0000
23655 +#define SCO_MS_ASYNC 0x0001
23656 +#define SCO_MS_INVALIDATE 0x0002
23658 +/* mlockall() flags */
23659 +#define SCO_MCL_CURRENT 0x0001
23660 +#define SCO_MCL_FUTURE 0x0002
23662 +#endif /* _ABI_SCO_MMAN_H */
23663 diff -Nru linux-2.6.7/include/abi/sco/signal.h linux-2.6.7-abi/include/abi/sco/signal.h
23664 --- linux-2.6.7/include/abi/sco/signal.h 1970-01-01 01:00:00.000000000 +0100
23665 +++ linux-2.6.7-abi/include/abi/sco/signal.h 2004-07-22 17:44:21.000000000 +0200
23667 +#ifndef _ABI_SCO_SIGNAL_H
23668 +#define _ABI_SCO_SIGNAL_H
23671 + * Signal numbers for the SCO emulator.
23676 +#define SCO_SIGHUP 1 /* hangup */
23677 +#define SCO_SIGINT 2 /* interrupt (rubout) */
23678 +#define SCO_SIGQUIT 3 /* quit (ASCII FS) */
23679 +#define SCO_SIGILL 4 /* illegal instruction (not reset when caught) */
23680 +#define SCO_SIGTRAP 5 /* trace trap (not reset when caught) */
23681 +#define SCO_SIGIOT 6 /* IOT instruction */
23682 +#define SCO_SIGABRT 6 /* used by abort, replace SIGIOT in the future */
23683 +#define SCO_SIGEMT 7 /* EMT instruction */
23684 +#define SCO_SIGFPE 8 /* floating point exception */
23685 +#define SCO_SIGKILL 9 /* kill (cannot be caught or ignored) */
23686 +#define SCO_SIGBUS 10 /* bus error */
23687 +#define SCO_SIGSEGV 11 /* segmentation violation */
23688 +#define SCO_SIGSYS 12 /* bad argument to system call */
23689 +#define SCO_SIGPIPE 13 /* write on a pipe with no one to read it */
23690 +#define SCO_SIGALRM 14 /* alarm clock */
23691 +#define SCO_SIGTERM 15 /* software termination signal from kill */
23692 +#define SCO_SIGUSR1 16 /* user defined signal 1 */
23693 +#define SCO_SIGUSR2 17 /* user defined signal 2 */
23694 +#define SCO_SIGCLD 18 /* death of a child */
23695 +#define SCO_SIGPWR 19 /* power-fail restart */
23696 +#define SCO_SIGWINCH 20 /* window change */
23697 +#define SCO_SIGURG 21 /* urgent socket condition */
23698 +#define SCO_SIGPOLL 22 /* pollable event occurred */
23699 +#define SCO_SIGSTOP 23 /* sendable stop signal not from tty */
23700 +#define SCO_SIGTSTP 24 /* stop signal from tty */
23701 +#define SCO_SIGCONT 25 /* continue a stopped process */
23702 +#define SCO_SIGTTIN 26 /* to readers pgrp upon background tty read */
23703 +#define SCO_SIGTTOU 27 /* like TTIN for output if tp->t_local&TOSTOP */
23704 +#define SCO_SIGVTALRM 28 /* virtual timer alarm */
23705 +#define SCO_SIGPROF 29 /* profile alarm */
23706 +#define SCO_SIGXCPU 30 /* CPU time limit exceeded */
23707 +#define SCO_SIGXFSZ 31 /* File size limit exceeded */
23709 +#endif /* _ABI_SCO_SIGNAL_H */
23710 diff -Nru linux-2.6.7/include/abi/sco/stat.h linux-2.6.7-abi/include/abi/sco/stat.h
23711 --- linux-2.6.7/include/abi/sco/stat.h 1970-01-01 01:00:00.000000000 +0100
23712 +++ linux-2.6.7-abi/include/abi/sco/stat.h 2004-07-22 17:44:21.000000000 +0200
23714 +#ifndef _ABI_SCO_STAT_H
23715 +#define _ABI_SCO_STAT_H
23719 +#include <abi/sco/types.h>
23722 +struct sco_xstat {
23723 + sco_dev_t st_dev;
23724 + u_int32_t __pad1[3];
23725 + sco_ino_t st_ino;
23726 + sco_mode_t st_mode;
23727 + sco_nlink_t st_nlink;
23728 + sco_uid_t st_uid;
23729 + sco_gid_t st_gid;
23730 + sco_dev_t st_rdev;
23731 + u_int32_t __pad2[2];
23732 + sco_off_t st_size;
23733 + u_int32_t __pad3;
23734 + sco_time_t st_atime;
23735 + sco_time_t st_mtime;
23736 + sco_time_t st_ctime;
23737 + int32_t st_blksize;
23738 + int32_t st_blocks;
23739 + char st_fstype[16];
23740 + u_int32_t __pad4[7];
23741 + int32_t st_sco_flags;
23744 +#endif /* _ABI_SCO_STAT_H */
23745 diff -Nru linux-2.6.7/include/abi/sco/sysent.h linux-2.6.7-abi/include/abi/sco/sysent.h
23746 --- linux-2.6.7/include/abi/sco/sysent.h 1970-01-01 01:00:00.000000000 +0100
23747 +++ linux-2.6.7-abi/include/abi/sco/sysent.h 2004-07-22 17:44:21.000000000 +0200
23750 + * Copyright (c) 2001 Christoph Hellwig.
23751 + * All rights reserved.
23753 + * This program is free software; you can redistribute it and/or modify
23754 + * it under the terms of the GNU General Public License as published by
23755 + * the Free Software Foundation; either version 2 of the License, or
23756 + * (at your option) any later version.
23758 + * This program is distributed in the hope that it will be useful,
23759 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
23760 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23761 + * GNU General Public License for more details.
23763 + * You should have received a copy of the GNU General Public License
23764 + * along with this program; if not, write to the Free Software
23765 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23767 +#ifndef _ABI_SCO_SYSENT_H
23768 +#define _ABI_SCO_SYSENT_H
23773 + * External function declarations for the SCO OpenServer syscall table.
23776 +#include <abi/sco/types.h>
23778 +struct sco_statvfs;
23782 +extern int sco_ioctl(struct pt_regs *);
23785 +extern int sco_lseek(int, u_long, int);
23786 +extern int sco_fcntl(int, u_int, u_long);
23787 +extern int sco_sysi86(int, void *, int);
23790 +extern int sco_mmap(u_long, size_t, int, int, int, sco_off_t);
23793 +extern int sco_ptrace(int, int, u_long, u_long);
23795 +/* secureware.c */
23796 +extern int sw_security(int, void *, void *, void *, void *, void *);
23799 +extern int sco_xstat(int, char *, void *);
23800 +extern int sco_lxstat(int, char *, void *);
23801 +extern int sco_fxstat(int, int, void *);
23804 +extern int sco_statvfs(char *, struct sco_statvfs *);
23805 +extern int sco_fstatvfs(int, struct sco_statvfs *);
23807 +#endif /* _ABI_SCO_SYSENT_H */
23808 diff -Nru linux-2.6.7/include/abi/sco/types.h linux-2.6.7-abi/include/abi/sco/types.h
23809 --- linux-2.6.7/include/abi/sco/types.h 1970-01-01 01:00:00.000000000 +0100
23810 +++ linux-2.6.7-abi/include/abi/sco/types.h 2004-07-22 17:44:21.000000000 +0200
23813 + * Copyright (c) 2001 Caldera Deutschland GmbH.
23814 + * Copyright (c) 2001 Christoph Hellwig.
23815 + * All rights reserved.
23817 + * This program is free software; you can redistribute it and/or modify
23818 + * it under the terms of the GNU General Public License as published by
23819 + * the Free Software Foundation; either version 2 of the License, or
23820 + * (at your option) any later version.
23822 + * This program is distributed in the hope that it will be useful,
23823 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
23824 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23825 + * GNU General Public License for more details.
23827 + * You should have received a copy of the GNU General Public License
23828 + * along with this program; if not, write to the Free Software
23829 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23831 +#ifndef _ABI_SCO_TYPES_H
23832 +#define _ABI_SCO_TYPES_H
23837 + * SCO OpenServer type declarations.
23839 +#include <linux/highuid.h>
23840 +#include <linux/personality.h>
23841 +#include <linux/sched.h>
23842 +#include <linux/types.h>
23845 +typedef int16_t sco_dev_t;
23846 +typedef u_int32_t sco_ino_t;
23847 +typedef u_int16_t sco_mode_t;
23848 +typedef int16_t sco_nlink_t;
23849 +typedef u_int16_t sco_uid_t;
23850 +typedef u_int16_t sco_gid_t;
23851 +typedef int32_t sco_off_t;
23852 +typedef int32_t sco_time_t;
23855 +struct sco_statvfs {
23856 + u_int32_t f_bsize;
23857 + u_int32_t f_frsize;
23858 + u_int32_t f_blocks;
23859 + u_int32_t f_bfree;
23860 + u_int32_t f_bavail;
23861 + u_int32_t f_files;
23862 + u_int32_t f_free;
23863 + u_int32_t f_favail;
23865 + char f_basetype[16];
23866 + u_int32_t f_flag;
23867 + u_int32_t f_namemax;
23869 + u_int32_t f_filler[16];
23874 + * Stub for now, as we still have a 16 bit dev_t.
23876 +static __inline sco_dev_t
23877 +linux_to_sco_dev_t(dev_t dev)
23883 + * If we thought we were in a short inode environment we are
23884 + * probably already too late - getdents() will have likely
23885 + * already assumed short inodes and "fixed" anything with
23886 + * a zero low word (because it must match stat() which must
23887 + * match read() on a directory).
23889 + * We will just have to go along with it.
23891 +static __inline sco_ino_t
23892 +linux_to_sco_ino_t(ino_t ino)
23894 + if (!is_cur_personality_flag(PERF_SHORT_INODE))
23896 + if ((u_long)ino & 0xffff)
23898 + return 0xfffffffe;
23902 + * SCO user/group IDs are the same as the old linux ones.
23904 +static __inline sco_uid_t
23905 +linux_to_sco_uid_t(uid_t uid)
23907 + return high2lowuid(uid);
23910 +static __inline sco_gid_t
23911 +linux_to_sco_gid_t(gid_t gid)
23913 + return high2lowgid(gid);
23916 +#endif /* _ABI_SCO_TYPES_H */
23917 diff -Nru linux-2.6.7/include/abi/signal.h linux-2.6.7-abi/include/abi/signal.h
23918 --- linux-2.6.7/include/abi/signal.h 1970-01-01 01:00:00.000000000 +0100
23919 +++ linux-2.6.7-abi/include/abi/signal.h 2004-07-22 17:44:21.000000000 +0200
23921 +#define NSIGNALS 32
23924 +/* These are the signal numbers for the SVr4 signal handling */
23925 +#define IBCS_SIGHUP 1
23926 +#define IBCS_SIGINT 2
23927 +#define IBCS_SIGQUIT 3
23928 +#define IBCS_SIGILL 4
23929 +#define IBCS_SIGTRAP 5
23930 +#define IBCS_SIGIOT 6
23931 +#define IBCS_SIGABRT 6
23932 +#define IBCS_SIGEMT 7
23933 +#define IBCS_SIGFPE 8
23934 +#define IBCS_SIGKILL 9
23935 +#define IBCS_SIGBUS 10
23936 +#define IBCS_SIGSEGV 11
23937 +#define IBCS_SIGSYS 12
23938 +#define IBCS_SIGPIPE 13
23939 +#define IBCS_SIGALRM 14
23940 +#define IBCS_SIGTERM 15
23941 +#define IBCS_SIGUSR1 16
23942 +#define IBCS_SIGUSR2 17
23943 +#define IBCS_SIGCLD 18
23944 +#define IBCS_SIGCHLD 18
23945 +#define IBCS_SIGPWR 19
23946 +#define IBCS_SIGWINCH 20
23947 +#define IBCS_SIGURG 21 /* not SCO, SCO uses SIGUSR2 for SIGURG */
23948 +#define IBCS_SIGPOLL 22
23949 +#define IBCS_SIGIO 22
23950 +#define IBCS_SIGSTOP 23
23951 +#define IBCS_SIGTSTP 24
23952 +#define IBCS_SIGCONT 25
23953 +#define IBCS_SIGTTIN 26
23954 +#define IBCS_SIGTTOU 27
23955 +#define IBCS_SIGVTALRM 28
23956 +#define IBCS_SIGPROF 29
23957 +#define IBCS_SIGGXCPU 30
23958 +#define IBCS_SIGGXFSZ 31
23960 +#define ISC_SIGSTOP 24
23961 +#define ISC_SIGTSTP 25
23962 +#define ISC_SIGCONT 23
23964 +/* These are the signal numbers used by BSD. */
23965 +#define BSD_SIGHUP 1
23966 +#define BSD_SIGINT 2
23967 +#define BSD_SIGQUIT 3
23968 +#define BSD_SIGILL 4
23969 +#define BSD_SIGTRAP 5
23970 +#define BSD_SIGABRT 6
23971 +#define BSD_SIGEMT 7
23972 +#define BSD_SIGFPE 8
23973 +#define BSD_SIGKILL 9
23974 +#define BSD_SIGBUS 10
23975 +#define BSD_SIGSEGV 11
23976 +#define BSD_SIGSYS 12
23977 +#define BSD_SIGPIPE 13
23978 +#define BSD_SIGALRM 14
23979 +#define BSD_SIGTERM 15
23980 +#define BSD_SIGURG 16
23981 +#define BSD_SIGSTOP 17
23982 +#define BSD_SIGTSTP 18
23983 +#define BSD_SIGCONT 19
23984 +#define BSD_SIGCHLD 20
23985 +#define BSD_SIGTTIN 21
23986 +#define BSD_SIGTTOU 22
23987 +#define BSD_SIGIO 23
23988 +#define BSD_SIGXCPU 24
23989 +#define BSD_SIGXFSZ 25
23990 +#define BSD_SIGVTALRM 26
23991 +#define BSD_SIGPROF 27
23992 +#define BSD_SIGWINCH 28
23993 +#define BSD_SIGINFO 29
23994 +#define BSD_SIGUSR1 30
23995 +#define BSD_SIGUSR2 31
23997 diff -Nru linux-2.6.7/include/abi/socksys.h linux-2.6.7-abi/include/abi/socksys.h
23998 --- linux-2.6.7/include/abi/socksys.h 1970-01-01 01:00:00.000000000 +0100
23999 +++ linux-2.6.7-abi/include/abi/socksys.h 2004-07-22 17:44:21.000000000 +0200
24002 + * Copyright (C) 1994 Mike Jagdis (jaggy@purplet.demon.co.uk)
24007 +#include <linux/netdevice.h>
24008 +/* Get struct rtentry from linux/route.h - this should be compatible. */
24009 +#include <linux/route.h>
24010 +/* Get struct arpreq from linux/if_arp.h - this should be compatible. */
24011 +#include <linux/if_arp.h>
24012 +/* Get struct ifreq and struct ifconf from linux/if.h - these should
24013 + * be compatible. */
24014 +#include <linux/if.h>
24017 +struct socksysreq {
24022 +struct socknewproto {
24023 + int family; /* address family (AF_INET, etc.) */
24024 + int type; /* protocol type (SOCK_STREAM, etc.) */
24025 + int proto; /* per family proto number */
24026 + dev_t dev; /* major/minor to use (must be a clone) */
24027 + int flags; /* protosw flags */
24031 +/* These are nothing to do with what we know as SO_*. I think they
24032 + * are the command requests which appear in socksysreq structures?
24034 +#define SSYS_SO_ACCEPT 1
24035 +#define SSYS_SO_BIND 2
24036 +#define SSYS_SO_CONNECT 3
24037 +#define SSYS_SO_GETPEERNAME 4
24038 +#define SSYS_SO_GETSOCKNAME 5
24039 +#define SSYS_SO_GETSOCKOPT 6
24040 +#define SSYS_SO_LISTEN 7
24041 +#define SSYS_SO_RECV 8
24042 +#define SSYS_SO_RECVFROM 9
24043 +#define SSYS_SO_SEND 10
24044 +#define SSYS_SO_SENDTO 11
24045 +#define SSYS_SO_SETSOCKOPT 12
24046 +#define SSYS_SO_SHUTDOWN 13
24047 +#define SSYS_SO_SOCKET 14
24048 +#define SSYS_SO_SELECT 15
24049 +#define SSYS_SO_GETIPDOMAIN 16
24050 +#define SSYS_SO_SETIPDOMAIN 17
24051 +#define SSYS_SO_ADJTIME 18
24052 +#define SSYS_SO_SETREUID 19
24053 +#define SSYS_SO_SETREGID 20
24054 +#define SSYS_SO_GETTIME 21
24055 +#define SSYS_SO_SETTIME 22
24056 +#define SSYS_SO_GETITIMER 23
24057 +#define SSYS_SO_SETITIMER 24
24058 +#define SSYS_SO_RECVMSG 25 /* Here down is SCO 3.2v5 and up */
24059 +#define SSYS_SO_SENDMSG 26
24060 +#define SSYS_SO_SOCKPAIR 27
24063 +/* We encode the ioctl numbers using the argument size as part of
24064 + * the number. This will warn us if we haven't got compatible
24065 + * structures :-).
24066 + * Naturally the SVR3/Lachman ioctl numbers are different from the
24067 + * BSD/SVR4-XTI ioctl numbers. What more would you expect?
24070 +#define SSYS_IOCPARM_MASK 0xff /* parameters must be < 256 bytes */
24071 +#define SSYS_IOC_VOID 0x20000000 /* no parameters */
24072 +#define SSYS_IOC_OUT 0x40000000 /* copy out parameters */
24073 +#define SSYS_IOC_IN 0x80000000 /* copy in parameters */
24074 +#define SSYS_IOC_INOUT (SSYS_IOC_IN|SSYS_IOC_OUT)
24076 +#define SSYS_IOS(x,y) (SSYS_IOC_VOID|(x<<8)|y)
24077 +#define SSYS_IOSR(x,y,t) (SSYS_IOC_OUT|((sizeof(t)&SSYS_IOCPARM_MASK)<<16)|(x<<8)|y)
24078 +#define SSYS_IOSW(x,y,t) (SSYS_IOC_IN|((sizeof(t)&SSYS_IOCPARM_MASK)<<16)|(x<<8)|y)
24079 +#define SSYS_IOSWR(x,y,t) (SSYS_IOC_INOUT|((sizeof(t)&SSYS_IOCPARM_MASK)<<16)|(x<<8)|y)
24081 +#define SSYS_SIOCSHIWAT SSYS_IOSW('S', 1, int) /* set high watermark */
24082 +#define SSYS_SIOCGHIWAT SSYS_IOSR('S', 2, int) /* get high watermark */
24083 +#define SSYS_SIOCSLOWAT SSYS_IOSW('S', 3, int) /* set low watermark */
24084 +#define SSYS_SIOCGLOWAT SSYS_IOSR('S', 4, int) /* get low watermark */
24085 +#define SSYS_SIOCATMARK SSYS_IOSR('S', 5, int) /* at oob mark? */
24086 +#define SSYS_SIOCSPGRP SSYS_IOSW('S', 6, int) /* set process group */
24087 +#define SSYS_SIOCGPGRP SSYS_IOSR('S', 7, int) /* get process group */
24090 +#define SSYS_FIONREAD SSYS_IOSR('S', 8, int) /* BSD compatibilty */
24091 +#define SSYS_FIONBIO SSYS_IOSW('S', 9, int) /* BSD compatibilty */
24092 +#define SSYS_FIOASYNC SSYS_IOSW('S', 10, int) /* BSD compatibilty */
24093 +#define SSYS_SIOCPROTO SSYS_IOSW('S', 11, struct socknewproto) /* link proto */
24094 +#define SSYS_SIOCGETNAME SSYS_IOSR('S', 12, struct sockaddr) /* getsockname */
24095 +#define SSYS_SIOCGETPEER SSYS_IOSR('S', 13, struct sockaddr) /* getpeername */
24096 +#define SSYS_IF_UNITSEL SSYS_IOSW('S', 14, int) /* set unit number */
24097 +#define SSYS_SIOCXPROTO SSYS_IOS('S', 15) /* empty proto table */
24099 +#define SSYS_SIOCADDRT SSYS_IOSW('R', 9, struct rtentry) /* add route */
24100 +#define SSYS_SIOCDELRT SSYS_IOSW('R', 10, struct rtentry) /* delete route */
24102 +#define SSYS_SIOCSIFADDR SSYS_IOSW('I', 11, struct ifreq) /* set ifnet address */
24103 +#define SSYS_SIOCGIFADDR SSYS_IOSWR('I', 12, struct ifreq) /* get ifnet address */
24104 +#define SSYS_SIOCSIFDSTADDR SSYS_IOSW('I', 13, struct ifreq) /* set p-p address */
24105 +#define SSYS_SIOCGIFDSTADDR SSYS_IOSWR('I', 14, struct ifreq) /* get p-p address */
24106 +#define SSYS_SIOCSIFFLAGS SSYS_IOSW('I', 15, struct ifreq) /* set ifnet flags */
24107 +#define SSYS_SIOCGIFFLAGS SSYS_IOSWR('I', 16, struct ifreq) /* get ifnet flags */
24108 +#define SSYS_SIOCGIFCONF SSYS_IOSWR('I', 17, struct ifconf) /* get ifnet list */
24110 +#define SSYS_SIOCSIFMTU SSYS_IOSW('I', 21, struct ifreq) /* get if_mtu */
24111 +#define SSYS_SIOCGIFMTU SSYS_IOSWR('I', 22, struct ifreq) /* set if_mtu */
24113 +#define SSYS_SIOCIFDETACH SSYS_IOSW('I', 26, struct ifreq) /* detach interface */
24114 +#define SSYS_SIOCGENPSTATS SSYS_IOSWR('I', 27, struct ifreq) /* get ENP stats */
24116 +#define SSYS_SIOCX25XMT SSYS_IOSWR('I', 29, struct ifreq) /* start a slp proc in
24118 +#define SSYS_SIOCX25RCV SSYS_IOSWR('I', 30, struct ifreq) /* start a slp proc in
24120 +#define SSYS_SIOCX25TBL SSYS_IOSWR('I', 31, struct ifreq) /* xfer lun table to
24123 +#define SSYS_SIOCGIFBRDADDR SSYS_IOSWR('I', 32, struct ifreq) /* get broadcast addr */
24124 +#define SSYS_SIOCSIFBRDADDR SSYS_IOSW('I', 33, struct ifreq) /* set broadcast addr */
24125 +#define SSYS_SIOCGIFNETMASK SSYS_IOSWR('I', 34, struct ifreq) /* get net addr mask */
24126 +#define SSYS_SIOCSIFNETMASK SSYS_IOSW('I', 35, struct ifreq) /* set net addr mask */
24127 +#define SSYS_SIOCGIFMETRIC SSYS_IOSWR('I', 36, struct ifreq) /* get IF metric */
24128 +#define SSYS_SIOCSIFMETRIC SSYS_IOSW('I', 37, struct ifreq) /* set IF metric */
24130 +#define SSYS_SIOCSARP SSYS_IOSW('I', 38, struct arpreq) /* set arp entry */
24131 +#define SSYS_SIOCGARP SSYS_IOSWR('I', 39, struct arpreq) /* get arp entry */
24132 +#define SSYS_SIOCDARP SSYS_IOSW('I', 40, struct arpreq) /* delete arp entry */
24134 +#define SSYS_SIOCSIFNAME SSYS_IOSW('I', 41, struct ifreq) /* set interface name */
24135 +#define SSYS_SIOCGIFONEP SSYS_IOSWR('I', 42, struct ifreq) /* get one-packet params */
24136 +#define SSYS_SIOCSIFONEP SSYS_IOSW('I', 43, struct ifreq) /* set one-packet params */
24138 +#define SSYS_SIOCGENADDR SSYS_IOSWR('I', 65, struct ifreq) /* Get ethernet addr */
24140 +#define SSYS_SIOCSOCKSYS SSYS_IOSW('I', 66, struct socksysreq) /* Pseudo socket syscall */
24143 +#define SVR4_SIOCSHIWAT SSYS_IOSW('s', 0, int) /* set high watermark */
24144 +#define SVR4_SIOCGHIWAT SSYS_IOSR('s', 1, int) /* get high watermark */
24145 +#define SVR4_SIOCSLOWAT SSYS_IOSW('s', 2, int) /* set low watermark */
24146 +#define SVR4_SIOCGLOWAT SSYS_IOSR('s', 3, int) /* get low watermark */
24147 +#define SVR4_SIOCATMARK SSYS_IOSR('s', 7, int) /* at oob mark? */
24148 +#define SVR4_SIOCSPGRP SSYS_IOSW('s', 8, int) /* set process group */
24149 +#define SVR4_SIOCGPGRP SSYS_IOSR('s', 9, int) /* get process group */
24151 +#define SVR4_SIOCADDRT SSYS_IOSW('r', 10, struct rtentry) /* add route */
24152 +#define SVR4_SIOCDELRT SSYS_IOSW('r', 11, struct rtentry) /* delete route */
24154 +#define SVR4_SIOCSIFADDR SSYS_IOSW('i', 12, struct ifreq) /* set ifnet address */
24155 +#define SVR4_SIOCGIFADDR SSYS_IOSWR('i',13, struct ifreq) /* get ifnet address */
24156 +#define SVR4_SIOCSIFDSTADDR SSYS_IOSW('i', 14, struct ifreq) /* set p-p address */
24157 +#define SVR4_SIOCGIFDSTADDR SSYS_IOSWR('i',15, struct ifreq) /* get p-p address */
24158 +#define SVR4_SIOCSIFFLAGS SSYS_IOSW('i', 16, struct ifreq) /* set ifnet flags */
24159 +#define SVR4_SIOCGIFFLAGS SSYS_IOSWR('i',17, struct ifreq) /* get ifnet flags */
24160 +#define SVR4_SIOCSIFMEM SSYS_IOSW('i', 18, struct ifreq) /* set interface mem */
24161 +#define SVR4_SIOCGIFMEM SSYS_IOSWR('i',19, struct ifreq) /* get interface mem */
24162 +#define SVR4_SIOCGIFCONF SSYS_IOSWR('i',20, struct ifconf) /* get ifnet list */
24163 +#define SVR4_SIOCSIFMTU SSYS_IOSW('i', 21, struct ifreq) /* set if_mtu */
24164 +#define SVR4_SIOCGIFMTU SSYS_IOSWR('i',22, struct ifreq) /* get if_mtu */
24166 + /* from 4.3BSD */
24167 +#define SVR4_SIOCGIFBRDADDR SSYS_IOSWR('i',23, struct ifreq) /* get broadcast addr */
24168 +#define SVR4_SIOCSIFBRDADDR SSYS_IOSW('i',24, struct ifreq) /* set broadcast addr */
24169 +#define SVR4_SIOCGIFNETMASK SSYS_IOSWR('i',25, struct ifreq) /* get net addr mask */
24170 +#define SVR4_SIOCSIFNETMASK SSYS_IOSW('i',26, struct ifreq) /* set net addr mask */
24171 +#define SVR4_SIOCGIFMETRIC SSYS_IOSWR('i',27, struct ifreq) /* get IF metric */
24172 +#define SVR4_SIOCSIFMETRIC SSYS_IOSW('i',28, struct ifreq) /* set IF metric */
24174 +#define SVR4_SIOCSARP SSYS_IOSW('i', 30, struct arpreq) /* set arp entry */
24175 +#define SVR4_SIOCGARP SSYS_IOSWR('i',31, struct arpreq) /* get arp entry */
24176 +#define SVR4_SIOCDARP SSYS_IOSW('i', 32, struct arpreq) /* delete arp entry */
24177 +#define SVR4_SIOCUPPER SSYS_IOSW('i', 40, struct ifreq) /* attach upper layer */
24178 +#define SVR4_SIOCLOWER SSYS_IOSW('i', 41, struct ifreq) /* attach lower layer */
24179 +#define SVR4_SIOCSETSYNC SSYS_IOSW('i', 44, struct ifreq) /* set syncmode */
24180 +#define SVR4_SIOCGETSYNC SSYS_IOSWR('i', 45, struct ifreq) /* get syncmode */
24181 +#define SVR4_SIOCSSDSTATS SSYS_IOSWR('i', 46, struct ifreq) /* sync data stats */
24182 +#define SVR4_SIOCSSESTATS SSYS_IOSWR('i', 47, struct ifreq) /* sync error stats */
24184 +#define SVR4_SIOCSPROMISC SSYS_IOSW('i', 48, int) /* request promisc mode
24186 +#define SVR4_SIOCADDMULTI SSYS_IOSW('i', 49, struct ifreq) /* set m/c address */
24187 +#define SVR4_SIOCDELMULTI SSYS_IOSW('i', 50, struct ifreq) /* clr m/c address */
24189 +/* protocol i/o controls */
24190 +#define SVR4_SIOCSNIT SSYS_IOSW('p', 0, struct nit_ioc) /* set nit modes */
24191 +#define SVR4_SIOCGNIT SSYS_IOSWR('p', 1, struct nit_ioc) /* get nit modes */
24193 +/* STREAMS based socket emulation */
24195 +#define SVR4_SIOCPROTO SSYS_IOSW('s', 51, struct socknewproto) /* link proto */
24196 +#define SVR4_SIOCGETNAME SSYS_IOSR('s', 52, struct sockaddr) /* getsockname */
24197 +#define SVR4_SIOCGETPEER SSYS_IOSR('s', 53, struct sockaddr) /* getpeername */
24198 +#define SVR4_IF_UNITSEL SSYS_IOSW('s', 54, int) /* set unit number */
24199 +#define SVR4_SIOCXPROTO SSYS_IOS('s', 55) /* empty proto table */
24201 +#define SVR4_SIOCIFDETACH SSYS_IOSW('i', 56, struct ifreq) /* detach interface */
24202 +#define SVR4_SIOCGENPSTATS SSYS_IOSWR('i', 57, struct ifreq) /* get ENP stats */
24203 +#define SVR4_SIOCX25XMT SSYS_IOSWR('i', 59, struct ifreq) /* start a slp proc in
24205 +#define SVR4_SIOCX25RCV SSYS_IOSWR('i', 60, struct ifreq) /* start a slp proc in
24207 +#define SVR4_SIOCX25TBL SSYS_IOSWR('i', 61, struct ifreq) /* xfer lun table to
24209 +#define SVR4_SIOCSLGETREQ SSYS_IOSWR('i', 71, struct ifreq) /* wait for switched
24210 + * SLIP request */
24211 +#define SVR4_SIOCSLSTAT SSYS_IOSW('i', 72, struct ifreq) /* pass SLIP info to
24213 +#define SVR4_SIOCSIFNAME SSYS_IOSW('i', 73, struct ifreq) /* set interface name */
24214 +#define SVR4_SIOCGENADDR SSYS_IOSWR('i', 85, struct ifreq) /* Get ethernet addr */
24215 +#define SVR4_SIOCSOCKSYS SSYS_IOSW('i', 86, struct socksysreq) /* Pseudo socket syscall */
24219 +/* Strange, there also seem to be two byte SVR4 ioctls used which are
24220 + * not simply the BSD style ioctl with the high word masked out. i.e the
24221 + * class character doesn't match what I expect.
24223 +#define SVRX_SIOCGIFCONF 0x8912
24224 +#define SVRX_SIOCGIFFLAGS 0x8913
24228 +/* With NFS/NIS there is also a pseudo device /dev/nfsd which understands
24229 + * some ioctls. Since these don't conflict with the socksys ioctls we
24230 + * just link nfsd to socksys and let socksys handle both sets.
24232 +#define NIOCNFSD 1
24233 +#define NIOCOLDGETFH 2
24234 +#define NIOCASYNCD 3
24235 +#define NIOCSETDOMNAM 4
24236 +#define NIOCGETDOMNAM 5
24237 +#define NIOCCLNTHAND 6
24238 +#define NIOCEXPORTFS 7
24239 +#define NIOCGETFH 8
24240 +#define NIOCLSTAT 9
24242 +/* These ioctls take argument structures... */
24243 +struct domnam_args {
24248 +struct lstat_args {
24253 +#define NFS_FHSIZE 32
24256 + unsigned short fsid; /* filesystem id (device) */
24257 + unsigned long fno; /* file number (inode) */
24258 + unsigned long fgen; /* file generation */
24259 + unsigned short ex_fsid; /* exported fs id (device) */
24260 + unsigned long ex_fno; /* exported file no (inode) */
24261 + unsigned long ex_fgen; /* exported file gen */
24263 + char pad[NFS_FHSIZE];
24266 +struct getfh_args {
24271 +extern void inherit_socksys_funcs(unsigned int fd, int state);
24272 +extern int socksys_fdinit(int fd, int rw, const char *buf, int *count);
24273 diff -Nru linux-2.6.7/include/abi/solaris/stat.h linux-2.6.7-abi/include/abi/solaris/stat.h
24274 --- linux-2.6.7/include/abi/solaris/stat.h 1970-01-01 01:00:00.000000000 +0100
24275 +++ linux-2.6.7-abi/include/abi/solaris/stat.h 2004-07-22 17:44:21.000000000 +0200
24277 +#ifndef _ABI_SOLARIS_STAT_H
24278 +#define _ABI_SOLARIS_STAT_H
24282 +#include <abi/solaris/types.h>
24285 +struct sol_stat64 {
24286 + sol_dev_t st_dev;
24287 + u_int32_t st_pad1[3];
24288 + sol_ino_t st_ino;
24289 + sol_mode_t st_mode;
24290 + sol_nlink_t st_nlink;
24291 + sol_uid_t st_uid;
24292 + sol_gid_t st_gid;
24293 + sol_dev_t st_rdev;
24294 + u_int32_t st_pad2[2];
24295 + sol_off_t st_size;
24296 + sol_time_t st_atime;
24297 + sol_time_t st_mtime;
24298 + sol_time_t st_ctime;
24299 + int32_t st_blksize;
24300 + int64_t st_blocks;
24301 + char st_fstype[16];
24302 + u_int32_t st_pad4[4];
24305 +#endif /* _ABI_SOLARIS_STAT_H */
24306 diff -Nru linux-2.6.7/include/abi/solaris/sysent.h linux-2.6.7-abi/include/abi/solaris/sysent.h
24307 --- linux-2.6.7/include/abi/solaris/sysent.h 1970-01-01 01:00:00.000000000 +0100
24308 +++ linux-2.6.7-abi/include/abi/solaris/sysent.h 2004-07-22 17:44:21.000000000 +0200
24310 +#ifndef _ABI_SOLARIS_SYSENT_H
24311 +#define _ABI_SOLARIS_SYSENT_H
24315 +struct sol_stat64;
24316 +struct sol_nmsghdr;
24321 +extern int sol_open64(const char *, int, int);
24322 +extern int sol_getdents64(int fd, char *, int);
24323 +extern int sol_mmap64(u_int, u_int, int, int, int, u_int, u_int);
24326 +extern int solaris_socket(int family, int type, int protocol);
24327 +extern int solaris_socketpair(int *usockvec);
24328 +extern int solaris_bind(int fd, struct sockaddr *addr, int addrlen);
24329 +extern int solaris_setsockopt(int fd, int level, int optname,
24330 + u32 optval, int optlen);
24331 +extern int solaris_getsockopt(int fd, int level, int optname,
24332 + u32 optval, u32 optlen);
24333 +extern int solaris_connect(int fd, struct sockaddr *addr, int addrlen);
24334 +extern int solaris_accept(int fd, struct sockaddr *addr, int *addrlen);
24335 +extern int solaris_listen(int fd, int backlog);
24336 +extern int solaris_shutdown(int fd, int how);
24337 +extern int solaris_recvfrom(int s, char *buf, int len, int flags,
24338 + u32 from, u32 fromlen);
24339 +extern int solaris_recv(int s, char *buf, int len, int flags);
24340 +extern int solaris_sendto(int s, char *buf, int len, int flags,
24341 + u32 to, u32 tolen);
24342 +extern int solaris_send(int s, char *buf, int len, int flags);
24343 +extern int solaris_getpeername(int fd, struct sockaddr *addr,
24345 +extern int solaris_getsockname(int fd, struct sockaddr *addr,
24347 +extern int solaris_sendmsg(int fd, struct sol_nmsghdr *user_msg,
24348 + unsigned user_flags);
24349 +extern int solaris_recvmsg(int fd, struct sol_nmsghdr *user_msg,
24350 + unsigned user_flags);
24352 +/* solarisx86.c */
24353 +extern int sol_llseek(struct pt_regs *regs);
24354 +extern int sol_memcntl(unsigned addr, unsigned len, int cmd,
24355 + unsigned arg, int attr, int mask);
24356 +extern int sol_acl(char *pathp, int cmd, int nentries, void *aclbufp);
24359 +extern int sol_stat64(char *, struct sol_stat64 *);
24360 +extern int sol_lstat64(char *, struct sol_stat64 *);
24361 +extern int sol_fstat64(u_int fd, struct sol_stat64 *);
24363 +#endif /* _ABI_SOLARIS_SYSENT_H */
24364 diff -Nru linux-2.6.7/include/abi/solaris/types.h linux-2.6.7-abi/include/abi/solaris/types.h
24365 --- linux-2.6.7/include/abi/solaris/types.h 1970-01-01 01:00:00.000000000 +0100
24366 +++ linux-2.6.7-abi/include/abi/solaris/types.h 2004-07-22 17:44:21.000000000 +0200
24369 + * Copyright (c) 2001 Christoph Hellwig.
24370 + * All rights reserved.
24372 + * This program is free software; you can redistribute it and/or modify
24373 + * it under the terms of the GNU General Public License as published by
24374 + * the Free Software Foundation; either version 2 of the License, or
24375 + * (at your option) any later version.
24377 + * This program is distributed in the hope that it will be useful,
24378 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
24379 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24380 + * GNU General Public License for more details.
24382 + * You should have received a copy of the GNU General Public License
24383 + * along with this program; if not, write to the Free Software
24384 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24386 +#ifndef _ABI_SOLARIS_TYPES_H
24387 +#define _ABI_SOLARIS_TYPES_H
24392 + * Solaris 2 type declarations.
24394 +#include <abi/svr4/types.h> /* Solaris 2 is based on SVR4 */
24396 +typedef svr4_dev_t sol_dev_t;
24397 +typedef u_int64_t sol_ino_t;
24398 +typedef svr4_mode_t sol_mode_t;
24399 +typedef svr4_nlink_t sol_nlink_t;
24400 +typedef svr4_uid_t sol_uid_t;
24401 +typedef svr4_gid_t sol_gid_t;
24402 +typedef int64_t sol_off_t;
24403 +typedef svr4_time_t sol_time_t;
24405 +typedef u_int64_t sol_fsblkcnt64_t;
24406 +typedef u_int64_t sol_fsfilcnt64_t;
24409 +#define linux_to_sol_dev_t(dev) \
24410 + linux_to_svr4_dev_t(dev)
24412 +#define linux_to_sol_ino_t(ino) \
24413 + linux_to_svr4_ino_t(ino)
24415 +#define linux_to_sol_uid_t(uid) \
24416 + linux_to_svr4_uid_t(uid)
24418 +#define linux_to_sol_gid_t(gid) \
24419 + linux_to_svr4_gid_t(gid)
24421 +#endif /* _ABI_SOLARIS_TYPES_H */
24422 diff -Nru linux-2.6.7/include/abi/stream.h linux-2.6.7-abi/include/abi/stream.h
24423 --- linux-2.6.7/include/abi/stream.h 1970-01-01 01:00:00.000000000 +0100
24424 +++ linux-2.6.7-abi/include/abi/stream.h 2004-07-22 17:44:21.000000000 +0200
24427 + * Copyright (C) 1994 Mike Jagdis (jaggy@purplet.demon.co.uk)
24429 +#ifndef _IBCS_STREAM_H_
24430 +#define _IBCS_STREAM_H_
24434 +#define MSG_HIPRI 1
24435 +#define RS_HIPRI MSG_HIPRI
24437 +#define MSG_BAND 4
24440 +#define MOREDATA 2
24443 + int maxlen; /* size of buffer */
24444 + int len; /* number of bytes in buffer */
24445 + char *buf; /* pointer to buffer */
24448 +/* Used for the I_PEEK STREAMS ioctl. */
24450 + struct strbuf ctl;
24451 + struct strbuf dat;
24455 +/* Used for the I_FDINSERT STREAMS ioctl. */
24456 +struct strfdinsert {
24457 + struct strbuf ctlbuf;
24458 + struct strbuf datbuf;
24460 + unsigned int fildes;
24464 +extern int stream_fdinsert(struct pt_regs *regs, int fd,
24465 + struct strfdinsert *arg);
24468 diff -Nru linux-2.6.7/include/abi/svr4/ioctl.h linux-2.6.7-abi/include/abi/svr4/ioctl.h
24469 --- linux-2.6.7/include/abi/svr4/ioctl.h 1970-01-01 01:00:00.000000000 +0100
24470 +++ linux-2.6.7-abi/include/abi/svr4/ioctl.h 2004-07-22 17:44:21.000000000 +0200
24472 +#ifndef _ABI_SVR4_IOCTL_H
24473 +#define _ABI_SVR4_IOCTL_H
24476 + * Function prototypes used for SVR4 ioctl emulation.
24481 +extern int __svr4_ioctl(struct pt_regs *, int, unsigned long, void *);
24484 +extern int svr4_console_ioctl(int, u_int, caddr_t);
24485 +extern int svr4_video_ioctl(int, u_int, caddr_t);
24488 +extern int svr4_fil_ioctl(int, u_int, caddr_t);
24491 +extern int svr4_stream_ioctl(struct pt_regs *regs, int, u_int, caddr_t);
24494 +extern int abi_ioctl_socksys(int, u_int, caddr_t);
24497 +extern int svr4_tape_ioctl(int, u_int, caddr_t);
24500 +extern int bsd_ioctl_termios(int, u_int, void *);
24501 +extern int svr4_term_ioctl(int, u_int, caddr_t);
24502 +extern int svr4_termiox_ioctl(int, u_int, caddr_t);
24505 +extern int svr4_sockmod_ioctl(int, u_int, caddr_t);
24506 +extern int do_getmsg(int, struct pt_regs *, char *, int,
24507 + int *, char *, int, int *, int *);
24508 +extern int do_putmsg(int, struct pt_regs *, char *, int,
24509 + char *, int, int);
24511 +#endif /* _ABI_SVR4_IOCTL_H */
24512 diff -Nru linux-2.6.7/include/abi/svr4/ipc.h linux-2.6.7-abi/include/abi/svr4/ipc.h
24513 --- linux-2.6.7/include/abi/svr4/ipc.h 1970-01-01 01:00:00.000000000 +0100
24514 +++ linux-2.6.7-abi/include/abi/svr4/ipc.h 2004-07-22 17:44:21.000000000 +0200
24517 + * Copyright (c) 1994 Mike Jagdis.
24518 + * Copyright (c) 2001 Christoph Hellwig.
24519 + * All rights reserved.
24521 + * This program is free software; you can redistribute it and/or modify
24522 + * it under the terms of the GNU General Public License as published by
24523 + * the Free Software Foundation; either version 2 of the License, or
24524 + * (at your option) any later version.
24526 + * This program is distributed in the hope that it will be useful,
24527 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
24528 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24529 + * GNU General Public License for more details.
24531 + * You should have received a copy of the GNU General Public License
24532 + * along with this program; if not, write to the Free Software
24533 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24535 +#ifndef _ABI_SVR4_IPC_H
24536 +#define _ABI_SVR4_IPC_H
24544 + SVR4_IPC_RMID = 0,
24545 + SVR4_IPC_SET = 1,
24546 + SVR4_IPC_STAT = 2,
24547 + SVR4_IPC_RMID_L = 10,
24548 + SVR4_IPC_SET_L = 11,
24549 + SVR4_IPC_STAT_L = 12,
24552 +struct ibcs2_ipc_perm {
24553 + u_int16_t uid; /* owner's user id */
24554 + u_int16_t gid; /* owner's group id */
24555 + u_int16_t cuid; /* creator's user id */
24556 + u_int16_t cgid; /* creator's group id */
24557 + u_int16_t mode; /* access modes */
24558 + u_int16_t seq; /* slot usage sequence number */
24559 + int32_t key; /* key */
24562 +struct abi4_ipc_perm {
24563 + u_int32_t uid; /* owner's user id */
24564 + u_int32_t gid; /* owner's group id */
24565 + u_int32_t cuid; /* creator's user id */
24566 + u_int32_t cgid; /* creator's group id */
24567 + u_int32_t mode; /* access modes */
24568 + u_int32_t seq; /* slot usage sequence number */
24569 + int32_t key; /* key */
24570 + int32_t pad[4]; /* reserved */
24583 +struct ibcs2_msqid_ds {
24584 + struct ibcs2_ipc_perm msg_perm;
24585 + struct msg *msg_first;
24586 + struct msg *msg_last;
24587 + u_int16_t msg_cbytes;
24588 + u_int16_t msg_qnum;
24589 + u_int16_t msg_qbytes;
24590 + u_int16_t msg_lspid;
24591 + u_int16_t msg_lrpid;
24592 + time_t msg_stime;
24593 + time_t msg_rtime;
24594 + time_t msg_ctime;
24598 + struct abi4_msg *msg_next;
24599 + int32_t msg_type;
24600 + u_int16_t msg_ts;
24601 + int16_t msg_spot;
24604 +struct abi4_msqid_ds {
24605 + struct abi4_ipc_perm msg_perm;
24606 + struct msg *msg_first;
24607 + struct msg *msg_last;
24608 + u_int32_t msg_cbytes;
24609 + u_int32_t msg_qnum;
24610 + u_int32_t msg_qbytes;
24611 + u_int32_t msg_lspid;
24612 + u_int32_t msg_lrpid;
24613 + u_int32_t msg_stime;
24614 + u_int32_t msg_pad1;
24615 + u_int32_t msg_rtime;
24616 + u_int32_t msg_pad2;
24617 + u_int32_t msg_ctime;
24618 + u_int32_t msg_pad3;
24619 + u_int32_t msg_pad4[4];
24632 +/* shmctl() operations */
24634 + SVR4_SHM_LOCK = 3,
24635 + SVR4_SHM_UNLOCK = 4,
24638 +struct ibcs2_shmid_ds {
24639 + struct ibcs2_ipc_perm shm_perm; /* operation permissions */
24640 + int32_t shm_segsz; /* size of segment in bytes */
24641 + struct region *__pad1; /* ptr to region structure */
24642 + char __pad2[4]; /* for swap compatibility */
24643 + u_int16_t shm_lpid; /* pid of last shmop */
24644 + u_int16_t shm_cpid; /* pid of creator */
24645 + u_int16_t shm_nattch; /* used only for shminfo */
24646 + u_int16_t __pad3;
24647 + time_t shm_atime; /* last shmat time */
24648 + time_t shm_dtime; /* last shmdt time */
24649 + time_t shm_ctime; /* last change time */
24652 +struct abi4_shmid_ds {
24653 + struct abi4_ipc_perm shm_perm; /* operation permissions */
24654 + int32_t shm_segsz; /* size of segment in bytes */
24655 + struct region *__pad1; /* ptr to region structure */
24656 + u_int16_t shm_lckcnt; /* number of locks */
24657 + char __pad2[2]; /* for swap compatibility */
24658 + u_int32_t shm_lpid; /* pid of last shmop */
24659 + u_int32_t shm_cpid; /* pid of creator */
24660 + u_int32_t shm_nattch;/* used only for shminfo */
24661 + u_int32_t shm_cnattch;
24662 + u_int32_t shm_atime; /* last shmat time */
24663 + u_int32_t shm_pad1;
24664 + u_int32_t shm_dtime; /* last shmdt time */
24665 + u_int32_t shm_pad2;
24666 + u_int32_t shm_ctime; /* last change time */
24667 + u_int32_t shm_pad3;
24668 + u_int32_t shm_pad4[4];
24680 +/* semctl() operations */
24682 + SVR4_SEM_GETNCNT = 3,
24683 + SVR4_SEM_GETPID = 4,
24684 + SVR4_SEM_GETVAL = 5,
24685 + SVR4_SEM_GETALL = 6,
24686 + SVR4_SEM_GETZCNT = 7,
24687 + SVR4_SEM_SETVAL = 8,
24688 + SVR4_SEM_SETALL = 9,
24691 +/* mapping of svr4 semaphore operations to Linux (if available) */
24692 +static int svr4sem2linux[] = {
24693 + [SVR4_IPC_RMID] = IPC_RMID,
24694 + [SVR4_IPC_SET] = IPC_SET,
24695 + [SVR4_IPC_STAT] = IPC_STAT,
24696 + [SVR4_SEM_GETNCNT] = GETNCNT,
24697 + [SVR4_SEM_GETPID] = GETPID,
24698 + [SVR4_SEM_GETVAL] = GETVAL,
24699 + [SVR4_SEM_GETALL] = GETALL,
24700 + [SVR4_SEM_GETZCNT] = GETZCNT,
24701 + [SVR4_SEM_SETVAL] = SETVAL,
24702 + [SVR4_SEM_SETALL] = SETALL,
24703 + [SVR4_IPC_RMID_L] = IPC_RMID,
24704 + [SVR4_IPC_SET_L] = IPC_SET,
24705 + [SVR4_IPC_STAT_L] = IPC_STAT,
24708 +struct ibcs2_semid_ds {
24709 + struct ibcs2_ipc_perm sem_perm;
24710 + struct sem *sem_base;
24711 + u_int16_t sem_nsems;
24713 + u_int32_t sem_otime;
24714 + u_int32_t sem_ctime;
24717 +struct abi4_semid_ds {
24718 + struct abi4_ipc_perm sem_perm;
24719 + struct sem *sem_base;
24720 + u_int16_t sem_nsems;
24721 + char __pad[2]; /* this pad is not in the abi doc! */
24722 + u_int32_t sem_otime;
24723 + u_int32_t sem_pad1;
24724 + u_int32_t sem_ctime;
24725 + u_int32_t sem_pad2;
24726 + u_int32_t sem_pad3[4];
24729 +#endif /* _ABI_SVR4_IPC_H */
24730 diff -Nru linux-2.6.7/include/abi/svr4/mman.h linux-2.6.7-abi/include/abi/svr4/mman.h
24731 --- linux-2.6.7/include/abi/svr4/mman.h 1970-01-01 01:00:00.000000000 +0100
24732 +++ linux-2.6.7-abi/include/abi/svr4/mman.h 2004-07-22 17:44:21.000000000 +0200
24735 + * Copyright (c) 2001 Christoph Hellwig.
24736 + * All rights reserved.
24738 + * This program is free software; you can redistribute it and/or modify
24739 + * it under the terms of the GNU General Public License as published by
24740 + * the Free Software Foundation; either version 2 of the License, or
24741 + * (at your option) any later version.
24743 + * This program is distributed in the hope that it will be useful,
24744 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
24745 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24746 + * GNU General Public License for more details.
24748 + * You should have received a copy of the GNU General Public License
24749 + * along with this program; if not, write to the Free Software
24750 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24752 +#ifndef _ABI_SVR4_MMAN_H
24753 +#define _ABI_SVR4_MMAN_H
24758 + * SVR4 memory mapped files declarations
24761 +#define SVR4_MAP_FAILED ((void *)-1)
24763 +/* protections flags for mmap() and mprotect() */
24764 +#define SVR4_PROT_NONE 0x0000
24765 +#define SVR4_PROT_READ 0x0001
24766 +#define SVR4_PROT_WRITE 0x0002
24767 +#define SVR4_PROT_EXEC 0x0004
24769 +/* sharing types for mmap() */
24770 +#define SVR4_MAP_SHARED 0x0001
24771 +#define SVR4_MAP_PRIVATE 0x0002
24772 +#define SVR4_MAP_FIXED 0x0010
24773 +#define SVR4_MAP_RENAME 0x0020
24774 +#define SVR4_MAP_NORESERVE 0x0040
24775 +#define SVR4_MAP_ANONYMOUS 0x0100
24776 +#define SVR4__MAP_NEW 0x80000000
24778 +#define SVR4_MAP_UNIMPL (SVR4_MAP_RENAME|SVR4__MAP_NEW)
24780 +/* memcntl() subfunctions */
24781 +#define SVR4_MC_SYNC 0x0001
24782 +#define SVR4_MC_LOCK 0x0002
24783 +#define SVR4_MC_UNLOCK 0x0003
24784 +#define SVR4_MC_ADVISE 0x0004
24785 +#define SVR4_MC_LOCKAS 0x0005
24786 +#define SVR4_MC_UNLOCKAS 0x0006
24788 +/* msync() flags */
24789 +#define SVR4_MS_SYNC 0x0000
24790 +#define SVR4_MS_ASYNC 0x0001
24791 +#define SVR4_MS_INVALIDATE 0x0002
24793 +/* mlockall() flags */
24794 +#define SVR4_MCL_CURRENT 0x0001
24795 +#define SVR4_MCL_FUTURE 0x0002
24797 +/* madvice() advices */
24798 +#define SVR4_MADV_NORMAL 0x0000
24799 +#define SVR4_MADV_RANDOM 0x0001
24800 +#define SVR4_MADV_SEQUENTIAL 0x0002
24801 +#define SVR4_MADV_WILLNEED 0x0003
24802 +#define SVR4_MADV_DONTNEED 0x0004
24804 +#endif /* _ABI_SVR4_MMAN_H */
24805 diff -Nru linux-2.6.7/include/abi/svr4/sigaction.h linux-2.6.7-abi/include/abi/svr4/sigaction.h
24806 --- linux-2.6.7/include/abi/svr4/sigaction.h 1970-01-01 01:00:00.000000000 +0100
24807 +++ linux-2.6.7-abi/include/abi/svr4/sigaction.h 2004-07-22 17:44:21.000000000 +0200
24809 +#ifndef _ABI_SVR4_SIGACTION_H
24810 +#define _ABI_SVR4_SIGACTION_H
24815 +struct task_struct;
24816 +extern void deactivate_signal(struct task_struct *, int);
24818 +struct abi_sigaction {
24820 + __sighandler_t sa_handler;
24821 + unsigned long sa_mask;
24822 + int sa_resv[2]; /* Reserved for something or another */
24824 +#define ABI_SA_ONSTACK 1
24825 +#define ABI_SA_RESETHAND 2
24826 +#define ABI_SA_RESTART 4
24827 +#define ABI_SA_SIGINFO 8
24828 +#define ABI_SA_NODEFER 16
24829 +#define ABI_SA_NOCLDWAIT 0x10000
24830 +#define ABI_SA_NOCLDSTOP 0x20000
24832 +#endif /* _ABI_SVR4_SIGACTION_H */
24833 diff -Nru linux-2.6.7/include/abi/svr4/siginfo.h linux-2.6.7-abi/include/abi/svr4/siginfo.h
24834 --- linux-2.6.7/include/abi/svr4/siginfo.h 1970-01-01 01:00:00.000000000 +0100
24835 +++ linux-2.6.7-abi/include/abi/svr4/siginfo.h 2004-07-22 17:44:21.000000000 +0200
24837 +#ifndef _ABI_SVR4_SIGINFO_H
24838 +#define _ABI_SVR4_SIGINFO_H
24840 +struct svr4_siginfo {
24845 + struct { /* kill(), SIGCLD */
24858 + struct { /* SIGSEGV, SIGBUS, SIGILL, SIGFPE */
24861 + struct { /* SIGPOLL, SIGXFSZ */
24868 +#endif /* _ABI_SVR4_SIGINFO_H */
24869 diff -Nru linux-2.6.7/include/abi/svr4/sigset.h linux-2.6.7-abi/include/abi/svr4/sigset.h
24870 --- linux-2.6.7/include/abi/svr4/sigset.h 1970-01-01 01:00:00.000000000 +0100
24871 +++ linux-2.6.7-abi/include/abi/svr4/sigset.h 2004-07-22 17:44:21.000000000 +0200
24873 +#ifndef _ABI_SVR4_SIGSET_H
24874 +#define _ABI_SVR4_SIGSET_H
24876 +typedef void (*svr4_sig_t)(int, void *, void *);
24877 +typedef struct svr4_sigset {
24878 + u_int setbits[4];
24881 +#endif /* _ABI_SVR4_SIGSET_H */
24882 diff -Nru linux-2.6.7/include/abi/svr4/sockio.h linux-2.6.7-abi/include/abi/svr4/sockio.h
24883 --- linux-2.6.7/include/abi/svr4/sockio.h 1970-01-01 01:00:00.000000000 +0100
24884 +++ linux-2.6.7-abi/include/abi/svr4/sockio.h 2004-07-22 17:44:21.000000000 +0200
24887 + * Copyright (c) 2001 Caldera Deutschland GmbH.
24888 + * Copyright (c) 2001 Christoph Hellwig.
24889 + * All rights reserved.
24891 + * This program is free software; you can redistribute it and/or modify
24892 + * it under the terms of the GNU General Public License as published by
24893 + * the Free Software Foundation; either version 2 of the License, or
24894 + * (at your option) any later version.
24896 + * This program is distributed in the hope that it will be useful,
24897 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
24898 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24899 + * GNU General Public License for more details.
24901 + * You should have received a copy of the GNU General Public License
24902 + * along with this program; if not, write to the Free Software
24903 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24905 +#ifndef _ABI_SVR4_SOCKIO_H
24906 +#define _ABI_SVR4_SOCKIO_H
24910 +#include <linux/socket.h> /* for "struct sockaddr" et al */
24911 +#include <abi/svr4/types.h> /* for "svr4_caddr_t" et al */
24914 +#define SVR4_IFF_UP 0x0001
24915 +#define SVR4_IFF_BROADCAST 0x0002
24916 +#define SVR4_IFF_DEBUG 0x0004
24917 +#define SVR4_IFF_LOOPBACK 0x0008
24918 +#define SVR4_IFF_POINTOPOINT 0x0010
24919 +#define SVR4_IFF_NOTRAILERS 0x0020
24920 +#define SVR4_IFF_RUNNING 0x0040
24921 +#define SVR4_IFF_NOARP 0x0080
24922 +#define SVR4_IFF_PROMISC 0x0100
24923 +#define SVR4_IFF_ALLMULTI 0x0200
24924 +#define SVR4_IFF_INTELLIGENT 0x0400
24925 +#define SVR4_IFF_MULTICAST 0x0800
24926 +#define SVR4_IFF_MULTI_BCAST 0x1000
24927 +#define SVR4_IFF_UNNUMBERED 0x2000
24928 +#define SVR4_IFF_PRIVATE 0x8000
24932 + * Struct used for one-packet mode params in if ioctls
24934 +struct svr4_onepacket {
24935 + u_int spsize; /* short packet size */
24936 + u_int spthresh; /* short packet threshold */
24940 + * Interface specific tuning information that TCP can use to its
24943 +struct svr4_ifperf {
24944 + u_int ip_recvspace; /* Receive window to use */
24945 + u_int ip_sendspace; /* Send window to use */
24946 + u_int ip_fullsize; /* use full-size frames */
24951 + * Interface request structure used for socket ioctl's. All interface
24952 + * ioctl's must have parameter definitions which begin with ifr_name. The
24953 + * remainder may be interface specific.
24955 +struct svr4_ifreq {
24956 +#define SVR4_IFNAMSIZ 16
24958 + char ifrn_name[SVR4_IFNAMSIZ];
24961 + struct sockaddr ifru_addr;
24962 + struct sockaddr ifru_dstaddr;
24963 + struct sockaddr ifru_broadaddr;
24965 + svr4_caddr_t ifru_data;
24966 + char ifru_enaddr[6];
24967 + struct svr4_onepacket ifru_onepacket;
24968 + struct svr4_ifperf ifru_perf;
24970 +#define svr4_ifr_name ifr_ifrn.ifrn_name /* if name, e.g. "en0" */
24971 +#define svr4_ifr_addr ifr_ifru.ifru_addr /* address */
24972 +#define svr4_ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of ptp link */
24973 +#define svr4_ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
24974 +#define svr4_ifr_flags ifr_ifru.ifru_int[0] /* flags */
24975 +#define svr4_ifr_metric ifr_ifru.ifru_int[1] /* metric */
24976 +#define svr4_ifr_mtu ifr_ifru.ifru_int[1] /* mtu */
24977 +#define svr4_ifr_ifindex ifr_ifru.ifru_int[1] /* ifindex */
24978 +#define svr4_ifr_nif ifr_ifru.ifru_int[1] /* # of interfaces */
24979 +#define svr4_ifr_naddr ifr_ifru.ifru_int[1] /* # of addresses */
24980 +#define svr4_ifr_type ifr_ifru.ifru_int[1] /* type of interface */
24981 +#define svr4_ifr_debug ifr_ifru.ifru_int[1] /* debug level */
24982 +#define svr4_ifr_muxid ifr_ifru.ifru_int[1] /* multiplexor id */
24983 +#define svr4_ifr_data ifr_ifru.ifru_data /* for use by interface */
24984 +#define svr4_ifr_enaddr ifr_ifru.ifru_enaddr /* ethernet address */
24985 +#define svr4_ifr_onepacket ifr_ifru.ifru_onepacket /* one-packet mode params */
24986 +#define svr4_ifr_perf ifr_ifru.ifru_perf /* tuning parameters */
24991 +extern int abi_do_setsockopt(unsigned long *sp);
24992 +extern int abi_do_getsockopt(unsigned long *sp);
24996 + * The original Linux socket file operations.
24997 + * We use it for two thing:
24998 + * o initializing the socksys socket file operations
24999 + * o to make calls to the original poll and release routines
25000 + * from our implementations.
25002 +extern struct file_operations socket_file_ops;
25004 +#endif /* _ABI_SVR4_SOCKIO_H */
25005 diff -Nru linux-2.6.7/include/abi/svr4/statfs.h linux-2.6.7-abi/include/abi/svr4/statfs.h
25006 --- linux-2.6.7/include/abi/svr4/statfs.h 1970-01-01 01:00:00.000000000 +0100
25007 +++ linux-2.6.7-abi/include/abi/svr4/statfs.h 2004-07-22 17:44:21.000000000 +0200
25009 +#ifndef _ABI_SVR4_STATFS_H
25010 +#define _ABI_SVR4_STATFS_H
25014 +#include <linux/types.h>
25017 +struct svr4_statfs {
25020 + int32_t f_frsize;
25021 + int32_t f_blocks;
25029 +#endif /* _ABI_SVR4_STATFS_H */
25030 diff -Nru linux-2.6.7/include/abi/svr4/stat.h linux-2.6.7-abi/include/abi/svr4/stat.h
25031 --- linux-2.6.7/include/abi/svr4/stat.h 1970-01-01 01:00:00.000000000 +0100
25032 +++ linux-2.6.7-abi/include/abi/svr4/stat.h 2004-07-22 17:44:21.000000000 +0200
25034 +#ifndef _ABI_SVR4_STAT_H
25035 +#define _ABI_SVR4_STAT_H
25039 +#include <abi/svr4/types.h>
25042 + * XXX this will need additions if we support emulation of
25043 + * XXX 64bit SVR4 on 64bit Linux
25046 +struct svr4_stat {
25047 + svr4_o_dev_t st_dev;
25048 + svr4_o_ino_t st_ino;
25049 + svr4_o_mode_t st_mode;
25050 + svr4_o_nlink_t st_nlink;
25051 + svr4_o_uid_t st_uid;
25052 + svr4_o_gid_t st_gid;
25053 + svr4_o_dev_t st_rdev;
25054 + svr4_off_t st_size;
25055 + svr4_time_t st_atime;
25056 + svr4_time_t st_mtime;
25057 + svr4_time_t st_ctime;
25060 +struct svr4_xstat {
25061 + svr4_dev_t st_dev;
25062 + u_int32_t st_pad1[3];
25063 + svr4_ino_t st_ino;
25064 + svr4_mode_t st_mode;
25065 + svr4_nlink_t st_nlink;
25066 + svr4_uid_t st_uid;
25067 + svr4_uid_t st_gid;
25068 + svr4_dev_t st_rdev;
25069 + u_int32_t st_pad2[2];
25070 + svr4_off_t st_size;
25071 + u_int32_t st_pad3;
25072 + svr4_timestruc_t st_atim;
25073 + svr4_timestruc_t st_mtim;
25074 + svr4_timestruc_t st_ctim;
25075 + u_int32_t st_blksize;
25076 + u_int32_t st_blocks;
25077 + char st_fstype[16];
25078 + u_int32_t st_pad4[8];
25082 + * Helpers that are used for other xstat implementations as well.
25086 +extern int report_svr4_stat(struct kstat *, struct svr4_stat *);
25087 +extern int report_svr4_xstat(struct kstat *, struct svr4_xstat *);
25089 +#endif /* _ABI_SVR4_STAT_H */
25090 diff -Nru linux-2.6.7/include/abi/svr4/sysconf.h linux-2.6.7-abi/include/abi/svr4/sysconf.h
25091 --- linux-2.6.7/include/abi/svr4/sysconf.h 1970-01-01 01:00:00.000000000 +0100
25092 +++ linux-2.6.7-abi/include/abi/svr4/sysconf.h 2004-07-22 17:44:21.000000000 +0200
25094 +#ifndef _ABI_SVR4_SYSCONF_H
25095 +#define _ABI_SVR4_SYSCONF_H
25100 + * Possible SVR4 sysconf parameters.
25103 +#define _CONFIG_NGROUPS 2 /* # configured supplemental groups */
25104 +#define _CONFIG_CHILD_MAX 3 /* max # of processes per uid session */
25105 +#define _CONFIG_OPEN_FILES 4 /* max # of open files per process */
25106 +#define _CONFIG_POSIX_VER 5 /* POSIX version */
25107 +#define _CONFIG_PAGESIZE 6 /* system page size */
25108 +#define _CONFIG_CLK_TCK 7 /* ticks per second */
25109 +#define _CONFIG_XOPEN_VER 8 /* XOPEN version */
25110 +#define _CONFIG_NACLS_MAX 9 /* for Enhanced Security */
25111 +#define _CONFIG_ARG_MAX 10 /* max length of exec args */
25112 +#define _CONFIG_NPROC 11 /* # processes system is config for */
25113 +#define _CONFIG_NENGINE 12 /* # configured processors (CPUs) */
25114 +#define _CONFIG_NENGINE_ONLN 13 /* # online processors (CPUs) */
25115 +#define _CONFIG_TOTAL_MEMORY 14 /* total memory */
25116 +#define _CONFIG_USEABLE_MEMORY 15 /* user + system memory */
25117 +#define _CONFIG_GENERAL_MEMORY 16 /* user only memory */
25118 +#define _CONFIG_DEDICATED_MEMORY 17 /* dedicated memory */
25119 +#define _CONFIG_NCGS_CONF 18 /* # CGs in system */
25120 +#define _CONFIG_NCGS_ONLN 19 /* # CGs online now */
25121 +#define _CONFIG_MAX_ENG_PER_CG 20 /* max engines per CG */
25122 +#define _CONFIG_CACHE_LINE 21 /* memory cache line size */
25123 +#define _CONFIG_SYSTEM_ID 22 /* system id assigned at ISL */
25124 +#define _CONFIG_KERNEL_VM 23 /* size of kernel virtual memory */
25126 +#endif /* _ABI_SVR4_SYSCONF_H */
25127 diff -Nru linux-2.6.7/include/abi/svr4/sysent.h linux-2.6.7-abi/include/abi/svr4/sysent.h
25128 --- linux-2.6.7/include/abi/svr4/sysent.h 1970-01-01 01:00:00.000000000 +0100
25129 +++ linux-2.6.7-abi/include/abi/svr4/sysent.h 2004-07-22 17:44:21.000000000 +0200
25131 +#ifndef _ABI_SVR4_SYSENT_H
25132 +#define _ABI_SVR4_SYSENT_H
25137 + * Function prototypes used for the SVR4 emulator.
25140 +#include <abi/svr4/types.h>
25141 +#include <abi/svr4/statfs.h>
25143 +struct abi_sigaction;
25144 +struct ibcs_statfs;
25146 +struct svr4_siginfo;
25147 +struct svr4_sigset;
25148 +struct svr4_statvfs;
25153 +/* MD (lcall7.c for i386) */
25154 +extern int lcall7_syscall(struct pt_regs *);
25155 +#define abi_syscall lcall7_syscall
25158 +extern unsigned short fl_svr4_to_linux[];
25159 +extern int svr4_fcntl(int, unsigned int, unsigned long);
25162 +extern int svr4_hrtsys(struct pt_regs *);
25165 +extern int svr4_ioctl(struct pt_regs *);
25168 +extern int svr4_semsys(struct pt_regs *);
25169 +extern int svr4_shmsys(struct pt_regs *);
25170 +extern int svr4_msgsys(struct pt_regs *);
25173 +extern int abi_brk(u_long);
25174 +extern int abi_exec(struct pt_regs *);
25175 +extern int abi_fork(struct pt_regs *);
25176 +extern int abi_getpid(struct pt_regs *);
25177 +extern int abi_getuid(struct pt_regs *);
25178 +extern int abi_getgid(struct pt_regs *);
25179 +extern int abi_mkdir(const char *, int);
25180 +extern int svr4_mknod(char *, svr4_o_mode_t, svr4_o_dev_t);
25181 +extern int svr4_xmknod(int, char *, svr4_mode_t, svr4_dev_t);
25182 +extern int abi_kill(int, int);
25183 +extern int abi_pipe(struct pt_regs *);
25184 +extern int abi_procids(struct pt_regs *);
25185 +extern int abi_read(int, char *, int);
25186 +extern int abi_select(int, void *, void *, void *, struct timeval *);
25187 +extern int abi_time(void);
25188 +extern int abi_wait(struct pt_regs *);
25191 +extern u_long svr4_mmap(u_long, size_t, int, int, int, svr4_off_t);
25194 +extern int svr4_open(const char *, int, int);
25195 +extern int svr4_statfs(const char *, struct svr4_statfs *, int, int);
25196 +extern int svr4_fstatfs(unsigned int, struct svr4_statfs *, int, int);
25197 +extern int svr4_getdents(int, char *, int);
25200 +extern int abi_sigsuspend(struct pt_regs *);
25201 +extern int abi_sigfunc(struct pt_regs *);
25202 +extern int abi_sigaction(int, const struct abi_sigaction *,
25203 + struct abi_sigaction *);
25204 +extern int abi_sigprocmask(int, u_long *, u_long *);
25205 +extern int abi_sigsuspend(struct pt_regs *);
25208 +extern int socksys_syscall(u_long *);
25211 +extern int svr4_getmsg(struct pt_regs *);
25212 +extern int svr4_putmsg(struct pt_regs *);
25213 +extern int svr4_getpmsg(struct pt_regs *);
25214 +extern int svr4_putpmsg(struct pt_regs *);
25217 +extern int svr4_access(char *, int);
25218 +extern int svr4_waitid(int, int, struct svr4_siginfo *, int);
25219 +extern int svr4_waitsys(struct pt_regs *);
25220 +extern int svr4_seteuid(int);
25221 +extern int svr4_setegid(int);
25222 +extern int svr4_fpathconf(int, int);
25223 +extern int svr4_pathconf(char *, int);
25224 +extern int svr4_sigpending(int, struct svr4_sigset *);
25225 +extern int svr4_context(struct pt_regs *);
25228 +extern int ibcs_sysconf(int);
25231 +extern int svr4_sysfs(int, int, int);
25234 +extern int svr4_sysinfo(int, char *, long);
25237 +extern int svr4_ulimit(int, int);
25238 +extern int svr4_getrlimit(int, void *);
25239 +extern int svr4_setrlimit(int, void *);
25242 +extern int svr4_stat(char *, struct svr4_stat *);
25243 +extern int svr4_lstat(char *, struct svr4_stat *);
25244 +extern int svr4_fstat(u_int, struct svr4_stat *);
25245 +extern int svr4_xstat(int, char *, void *);
25246 +extern int svr4_fxstat(int, int, void *);
25247 +extern int svr4_lxstat(int, char *, void *);
25250 +extern int svr4_sysconfig(int);
25253 +extern int svr4_sysi86(int, void *, int);
25256 +extern int abi_utsname(u_long);
25257 +extern int v7_utsname(u_long);
25260 +extern int svr4_statvfs(char *, struct svr4_statvfs *);
25261 +extern int svr4_fstatvfs(int, struct svr4_statvfs *);
25264 +#endif /* _ABI_SVR4_SYSENT_H */
25265 diff -Nru linux-2.6.7/include/abi/svr4/termios.h linux-2.6.7-abi/include/abi/svr4/termios.h
25266 --- linux-2.6.7/include/abi/svr4/termios.h 1970-01-01 01:00:00.000000000 +0100
25267 +++ linux-2.6.7-abi/include/abi/svr4/termios.h 2004-07-22 17:44:21.000000000 +0200
25269 +#ifndef _ABI_SVR4_TERMIOS_H
25270 +#define _ABI_SVR4_TERMIOS_H
25275 + * SVR4 termios declarations.
25279 +struct svr_termio {
25280 + u_int16_t c_iflag;
25281 + u_int16_t c_oflag;
25282 + u_int16_t c_cflag;
25283 + u_int16_t c_lflag;
25285 + u_char c_cc[SVR_NCC];
25288 +#define SVR4_NCCS (19)
25289 +struct svr4_termios {
25294 + u_char c_cc[SVR4_NCCS];
25297 +#endif /* _ABI_SVR4_TERMIOS_H */
25298 diff -Nru linux-2.6.7/include/abi/svr4/types.h linux-2.6.7-abi/include/abi/svr4/types.h
25299 --- linux-2.6.7/include/abi/svr4/types.h 1970-01-01 01:00:00.000000000 +0100
25300 +++ linux-2.6.7-abi/include/abi/svr4/types.h 2004-07-22 17:44:21.000000000 +0200
25303 + * Copyright (c) 2001 Caldera Deutschland GmbH.
25304 + * Copyright (c) 2001 Christoph Hellwig.
25305 + * All rights reserved.
25307 + * This program is free software; you can redistribute it and/or modify
25308 + * it under the terms of the GNU General Public License as published by
25309 + * the Free Software Foundation; either version 2 of the License, or
25310 + * (at your option) any later version.
25312 + * This program is distributed in the hope that it will be useful,
25313 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
25314 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25315 + * GNU General Public License for more details.
25317 + * You should have received a copy of the GNU General Public License
25318 + * along with this program; if not, write to the Free Software
25319 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25321 +#ifndef _ABI_SVR4_TYPES_H
25322 +#define _ABI_SVR4_TYPES_H
25327 + * SVR4 type declarations.
25329 +#include <linux/highuid.h>
25330 +#include <linux/personality.h>
25331 +#include <linux/sched.h>
25332 +#include <linux/types.h>
25335 + * XXX this will need additions if we support emulation of
25336 + * XXX 64bit SVR4 on 64bit Linux
25338 +typedef u_int32_t svr4_dev_t;
25339 +typedef u_int32_t svr4_ino_t;
25340 +typedef u_int32_t svr4_mode_t;
25341 +typedef u_int32_t svr4_nlink_t;
25342 +typedef int32_t svr4_uid_t;
25343 +typedef int32_t svr4_gid_t;
25344 +typedef int32_t svr4_off_t;
25345 +typedef int32_t svr4_time_t;
25346 +typedef struct timeval svr4_timestruc_t;
25348 +typedef int16_t svr4_o_dev_t;
25349 +typedef int16_t svr4_o_pid_t;
25350 +typedef u_int16_t svr4_o_ino_t;
25351 +typedef u_int16_t svr4_o_mode_t;
25352 +typedef int16_t svr4_o_nlink_t;
25353 +typedef u_int16_t svr4_o_uid_t;
25354 +typedef u_int16_t svr4_o_gid_t;
25357 + * Convert a linux dev number into the SVR4 equivalent.
25359 +static __inline svr4_dev_t
25360 +linux_to_svr4_dev_t(dev_t dev)
25362 + return (dev & 0xff) | ((dev & 0xff00) << 10);
25366 + * SVR4 old (=SVR3) dev_t is the same as linux.
25368 +static __inline svr4_o_dev_t
25369 +linux_to_svr4_o_dev_t(dev_t dev)
25375 + * If we thought we were in a short inode environment we are
25376 + * probably already too late - getdents() will have likely
25377 + * already assumed short inodes and "fixed" anything with
25378 + * a zero low word (because it must match stat() which must
25379 + * match read() on a directory).
25381 + * We will just have to go along with it.
25383 +static __inline svr4_ino_t
25384 +linux_to_svr4_ino_t(ino_t ino)
25386 + if (!is_cur_personality_flag(PERF_SHORT_INODE))
25388 + if ((u_long)ino & 0xffff)
25390 + return 0xfffffffe;
25394 + * Old SVR4 ino_t _must_ be in a short inode enviroment.
25396 +static __inline svr4_o_ino_t
25397 +linux_to_svr4_o_ino_t(ino_t ino)
25399 + if ((u_long)ino & 0xffff)
25400 + return (svr4_o_ino_t)ino;
25405 + * SVR4 UIDs/GIDs are the same as current Linux ones,
25406 + * old (SVR3) ones are the same as old Linux ones.
25408 +static __inline svr4_uid_t
25409 +linux_to_svr4_uid_t(uid_t uid)
25414 +static __inline svr4_o_uid_t
25415 +linux_to_svr4_o_uid_t(uid_t uid)
25417 + return high2lowuid(uid);
25420 +static __inline svr4_gid_t
25421 +linux_to_svr4_gid_t(gid_t gid)
25426 +static __inline svr4_o_gid_t
25427 +linux_to_svr4_o_gid_t(gid_t gid)
25429 + return high2lowgid(gid);
25432 +#endif /* _ABI_SVR4_TYPES_H */
25433 diff -Nru linux-2.6.7/include/abi/tli.h linux-2.6.7-abi/include/abi/tli.h
25434 --- linux-2.6.7/include/abi/tli.h 1970-01-01 01:00:00.000000000 +0100
25435 +++ linux-2.6.7-abi/include/abi/tli.h 2004-07-22 17:44:21.000000000 +0200
25452 +/* Error codes used by TLI transport providers. */
25453 +#define TBADADDR 1
25458 +#define TOUTSTATE 6
25462 +#define TBADDATA 10
25463 +#define TBUFOVFLW 11
25465 +#define TNODATA 13
25467 +#define TNOUDERR 15
25468 +#define TBADFLAG 16
25470 +#define TNOTSUPPORT 18
25471 +#define TSTATECHNG 19
25474 +/* User level states (maintained internally by libnsl_s). */
25475 +#define T_UNINIT 0
25478 +#define T_OUTCON 3
25480 +#define T_DATAXFER 5
25481 +#define T_OUTREL 6
25486 +/* Kernel level states of a transport end point. */
25487 +#define TS_UNBND 0 /* unbound */
25488 +#define TS_WACK_BREQ 1 /* waiting for T_BIND_REQ ack */
25489 +#define TS_WACK_UREQ 2 /* waiting for T_UNBIND_REQ ack */
25490 +#define TS_IDLE 3 /* idle */
25491 +#define TS_WACK_OPTREQ 4 /* waiting for T_OPTMGMT_REQ ack */
25492 +#define TS_WACK_CREQ 5 /* waiting for T_CONN_REQ ack */
25493 +#define TS_WCON_CREQ 6 /* waiting for T_CONN_REQ confirmation */
25494 +#define TS_WRES_CIND 7 /* waiting for T_CONN_IND */
25495 +#define TS_WACK_CRES 8 /* waiting for T_CONN_RES ack */
25496 +#define TS_DATA_XFER 9 /* data transfer */
25497 +#define TS_WIND_ORDREL 10 /* releasing read but not write */
25498 +#define TS_WREQ_ORDREL 11 /* wait to release write but not read */
25499 +#define TS_WACK_DREQ6 12 /* waiting for T_DISCON_REQ ack */
25500 +#define TS_WACK_DREQ7 13 /* waiting for T_DISCON_REQ ack */
25501 +#define TS_WACK_DREQ9 14 /* waiting for T_DISCON_REQ ack */
25502 +#define TS_WACK_DREQ10 15 /* waiting for T_DISCON_REQ ack */
25503 +#define TS_WACK_DREQ11 16 /* waiting for T_DISCON_REQ ack */
25504 +#define TS_NOSTATES 17
25507 +/* Messages used by "timod". */
25508 +#define T_CONN_REQ 0
25509 +#define T_CONN_RES 1
25510 +#define T_DISCON_REQ 2
25511 +#define T_DATA_REQ 3
25512 +#define T_EXDATA_REQ 4
25513 +#define T_INFO_REQ 5
25514 +#define T_BIND_REQ 6
25515 +#define T_UNBIND_REQ 7
25516 +#define T_UNITDATA_REQ 8
25517 +#define T_OPTMGMT_REQ 9
25518 +#define T_ORDREL_REQ 10
25520 +#define T_CONN_IND 11
25521 +#define T_CONN_CON 12
25522 +#define T_DISCON_IND 13
25523 +#define T_DATA_IND 14
25524 +#define T_EXDATA_IND 15
25525 +#define T_INFO_ACK 16
25526 +#define T_BIND_ACK 17
25527 +#define T_ERROR_ACK 18
25528 +#define T_OK_ACK 19
25529 +#define T_UNITDATA_IND 20
25530 +#define T_UDERROR_IND 21
25531 +#define T_OPTMGMT_ACK 22
25532 +#define T_ORDREL_IND 23
25534 +/* Flags used from user level library routines. */
25535 +#define T_MORE 0x0001
25536 +#define T_EXPEDITED 0x0002
25537 +#define T_NEGOTIATE 0x0004
25538 +#define T_CHECK 0x0008
25539 +#define T_DEFAULT 0x0010
25540 +#define T_SUCCESS 0x0020
25541 +#define T_FAILURE 0x0040
25542 +#define T_CURRENT 0x0080
25543 +#define T_PARTSUCCESS 0x0100
25544 +#define T_READONLY 0x0200
25545 +#define T_NOTSUPPORT 0x0400
25548 +struct T_conn_req {
25549 + long PRIM_type; /* T_CONN_REQ */
25550 + long DEST_length;
25551 + long DEST_offset;
25556 +struct T_conn_res {
25557 + long PRIM_type; /* T_CONN_RES */
25564 +struct T_discon_req {
25565 + long PRIM_type; /* T_DISCON_REQ */
25569 +struct T_data_req {
25570 + long PRIM_type; /* T_DATA_REQ */
25574 +struct T_exdata_req {
25575 + long PRIM_type; /* T_EXDATA_REQ */
25579 +struct T_info_req {
25580 + long PRIM_type; /* T_INFO_REQ */
25583 +struct T_bind_req {
25584 + long PRIM_type; /* T_BIND_REQ */
25585 + long ADDR_length;
25586 + long ADDR_offset;
25587 + unsigned long CONIND_number;
25590 +struct T_unbind_req {
25591 + long PRIM_type; /* T_UNBIND_REQ */
25594 +struct T_unitdata_req {
25595 + long PRIM_type; /* T_UNITDATA_REQ */
25596 + long DEST_length;
25597 + long DEST_offset;
25602 +struct T_optmgmt_req {
25603 + long PRIM_type; /* T_OPTMGMT_REQ */
25609 +struct T_ordrel_req {
25610 + long PRIM_type; /* T_ORDREL_REQ */
25614 +struct T_conn_ind {
25615 + long PRIM_type; /* T_CONN_IND */
25623 +struct T_conn_con {
25624 + long PRIM_type; /* T_CONN_CON */
25631 +struct T_discon_ind {
25632 + long PRIM_type; /* T_DISCON_IND */
25633 + long DISCON_reason;
25637 +struct T_data_ind {
25638 + long PRIM_type; /* T_DATA_IND */
25642 +struct T_exdata_ind {
25643 + long PRIM_type; /* T_EXDATA_IND */
25647 +/* information acknowledgment */
25649 +struct T_info_ack {
25650 + long PRIM_type; /* T_INFO_ACK */
25659 + long CURRENT_state;
25660 + long PROVIDER_flag;
25663 +struct T_bind_ack {
25664 + long PRIM_type; /* T_BIND_ACK */
25665 + long ADDR_length;
25666 + long ADDR_offset;
25667 + unsigned long CONIND_number;
25670 +struct T_error_ack {
25671 + long PRIM_type; /* T_ERROR_ACK */
25678 + long PRIM_type; /* T_OK_ACK */
25679 + long CORRECT_prim;
25682 +struct T_unitdata_ind {
25683 + long PRIM_type; /* T_UNITDATA_IND */
25690 +struct T_uderror_ind {
25691 + long PRIM_type; /* T_UDERROR_IND */
25692 + long DEST_length;
25693 + long DEST_offset;
25699 +struct T_optmgmt_ack {
25700 + long PRIM_type; /* T_OPTMGMT_ACK */
25706 +struct T_ordrel_ind {
25707 + long PRIM_type; /* T_ORDREL_IND */
25711 +union T_primitives {
25713 + struct T_conn_req conn_req;
25714 + struct T_conn_res conn_res;
25715 + struct T_discon_req discon_req;
25716 + struct T_data_req data_req;
25717 + struct T_exdata_req exdata_req;
25718 + struct T_info_req info_req;
25719 + struct T_bind_req bind_req;
25720 + struct T_unbind_req unbind_req;
25721 + struct T_unitdata_req unitdata_req;
25722 + struct T_optmgmt_req optmgmt_req;
25723 + struct T_ordrel_req ordrel_req;
25724 + struct T_conn_ind conn_ind;
25725 + struct T_conn_con conn_con;
25726 + struct T_discon_ind discon_ind;
25727 + struct T_data_ind data_ind;
25728 + struct T_exdata_ind exdata_ind;
25729 + struct T_info_ack info_ack;
25730 + struct T_bind_ack bind_ack;
25731 + struct T_error_ack error_ack;
25732 + struct T_ok_ack ok_ack;
25733 + struct T_unitdata_ind unitdata_ind;
25734 + struct T_uderror_ind uderror_ind;
25735 + struct T_optmgmt_ack optmgmt_ack;
25736 + struct T_ordrel_ind ordrel_ind;
25740 +/* The t_opthdr structure defines the layout of options in a T_OPTMGMT_*
25741 + * data buffer. This is specified in the X/Open specs but does not
25742 + * appear to exist in SCO 3.2.x, SCO OS5, Interactive SVR4 or UnixWare 1.x.
25743 + * There are programs that make options request however.
25744 + * The older TLI uses struct opthdr which is different and incompatible
25748 + unsigned long len; /* *Total* length including header */
25749 + unsigned long level;
25750 + unsigned long name;
25751 + unsigned long status;
25752 + char value[0]; /* and onwards... */
25758 + long len; /* Length of option value */
25759 + char value[0]; /* and onwards... */
25764 + struct T_primsg *next;
25765 + unsigned char pri;
25766 + unsigned char band;
25771 +#define XTI_MAGIC 638654838
25773 +struct T_private {
25777 + struct T_primsg *pfirst, *plast;
25780 +#define Priv(file) ((struct T_private *)(file->private_data))
25782 +extern int timod_ioctl(struct pt_regs *, int, unsigned int, void *, int, int *);
25783 +extern int timod_putmsg(int, struct inode *, int, struct pt_regs *);
25784 +extern int timod_getmsg(int, struct inode *, int, struct pt_regs *);
25785 +extern int timod_update_socket(int, struct file *, struct pt_regs *);
25787 +#ifndef SOCKSYS_MAJOR
25788 +#define SOCKSYS_MAJOR 30
25791 +#endif /* __TLI_H */
25792 diff -Nru linux-2.6.7/include/abi/unused-termios.h linux-2.6.7-abi/include/abi/unused-termios.h
25793 --- linux-2.6.7/include/abi/unused-termios.h 1970-01-01 01:00:00.000000000 +0100
25794 +++ linux-2.6.7-abi/include/abi/unused-termios.h 2004-07-22 17:44:21.000000000 +0200
25797 + * This file was entered from the book
25798 + * Intel386 Family Binary Compatability Specification 2
25799 + * McGraw-Hill Book company
25800 + * ISBN 0-07-031219-2
25808 +typedef unsigned short tcflag_t;
25809 +typesef unsigned char cc_t;
25810 +typedef unsigned long speed_t;
25813 + unsigned short c_iflag;
25814 + unsigned short c_oflag;
25815 + unsigned short c_cflag;
25816 + unsigned short c_lflag;
25818 + unsigned char c_cc[NC];
25822 + tcflag_t c_iflag;
25823 + tcflag_t c_oflag;
25824 + tcflag_t c_cflag;
25825 + tcflag_t c_lflag;
25849 +#define CINTR 0177
25851 +#define CERASE '#'
25853 +#define CSTART 021
25855 +#define CSWTCH 032
25859 +#define IGNBRK 0000001
25860 +#define BRKINT 0000002
25861 +#define IGNPAR 0000004
25862 +#define PARMRK 0000010
25863 +#define INPCK 0000020
25864 +#define ISTRIP 0000040
25865 +#define INLCR 0000100
25866 +#define IGNCR 0000200
25867 +#define ICRNL 0000400
25868 +#define IUCLC 0001000
25869 +#define IXON 0002000
25870 +#define IXANY 0004000
25871 +#define IXOFF 0010000
25872 +#define IMAXBEL 0020000 /* RESERVED */
25873 +#define DOSMODE 0100000
25875 +#define OPOST 00000001
25876 +#define OLCUC 00000002
25877 +#define ONLCR 00000004
25878 +#define OCRNL 00000010
25879 +#define ONOCR 00000020
25880 +#define ONLRET 00000040
25881 +#define OFILL 00000100
25882 +#define OFDEL 00000200
25883 +#define NLDLY 00000400
25885 +#define NL1 00000400
25886 +#define CRDLY 00003000
25888 +#define CR1 00001000
25889 +#define CR2 00002000
25890 +#define CR3 00003000
25891 +#define TABDLY 00014000
25893 +#define TAB1 00004000
25894 +#define TAB2 00010000
25895 +#define TAB3 00014000
25896 +#define BSDLY 00200000
25898 +#define BS1 00200000
25899 +#define VTDLY 00400000
25901 +#define VT1 00400000
25902 +#define FFDLY 01000000
25904 +#define FF1 01000000
25906 +#define CBAUD 0000017
25907 +#define CSIZE 0000060
25909 +#define CS6 0000020
25910 +#define CS7 0000040
25911 +#define CS8 0000060
25912 +#define CSTOPB 0000100
25913 +#define CREAD 0000200
25914 +#define PARENB 0000400
25915 +#define PARODD 0001000
25916 +#define HUPCL 0002000
25917 +#define CLOCAL 0004000
25918 +#define RCV1EN 0010000
25919 +#define XMT1EN 0020000
25920 +#define LOBLK 0040000
25921 +#define XCLUDE 0100000
25923 +#define ISIG 0000001
25924 +#define ICANON 0000002
25925 +#define XCASE 0000004
25926 +#define ECHO 0000010
25927 +#define ECHOE 0000020
25928 +#define ECHOK 0000040
25929 +#define ECHONL 0000100
25930 +#define NOFLSH 0000200
25931 +#define IEXTEN 0000400
25932 +#defien TOSTOP 0001000
25934 +/* Bits 10-15 (0176000) in the c_lflag field are RESERVED */
25937 +#define XIOC ('x'<<8) Level 2
25939 +#define XIOC (('i'<<8)|('X'<<16))
25940 +#define XCGETA (XIOC|1)
25941 +#define XCSETA (XIOC|2)
25942 +#define XCSETAW (XIOC|3)
25943 +#define XCSETAF (XIOC|4)
25945 +#define TIOC ('T'<<8)
25947 +#define TCGETA (TIOC|1)
25948 +#define TCSETA (TIOC|2)
25949 +#define TCSETAW (TIOC|3)
25950 +#define TCSETAF (TIOC|4)
25951 +#define TCSBRK (TIOC|5)
25952 +#define TCXONC (TIOC|6)
25953 +#define TCFLSH (TIOC|7)
25955 +#define TIOCGWINSZ (TIOC|104)
25956 +#define TIOCSWINSZ (TIOC|103)
25958 +#define TCSANOW XCSETA
25959 +#define TCSADRAIN XCSETAW
25960 +#define TCSAFLUSH XCSETAF
25961 +#define TCSADFLUSH XCSETAF
25963 +#define TCIFLUSH 0
25964 +#define TCOFLUSH 1
25965 +#define TCIOFLUSH 2
25990 + unsigned short ws_row;
25991 + unsigned short ws_col;
25992 + unsigned short ws_xpixel;
25993 + unsigned short ws_ypixel;
25995 diff -Nru linux-2.6.7/include/abi/util/errno.h linux-2.6.7-abi/include/abi/util/errno.h
25996 --- linux-2.6.7/include/abi/util/errno.h 1970-01-01 01:00:00.000000000 +0100
25997 +++ linux-2.6.7-abi/include/abi/util/errno.h 2004-07-22 17:44:21.000000000 +0200
25999 +#ifndef _ABI_UTIL_ERRNO_H
26000 +#define _ABI_UTIL_ERRNO_H
26004 +#include <asm/abi_machdep.h>
26005 +#include <abi/util/map.h>
26008 + * Translate the errno numbers from linux to current personality.
26009 + * This should be removed and all other sources changed to call the
26010 + * map function above directly.
26012 +#define iABI_errors(errno) \
26013 + (map_value(current_thread_info()->exec_domain->err_map, errno, 1))
26015 +#endif /* _ABI_UTIL_ERRNO_H */
26016 diff -Nru linux-2.6.7/include/abi/util/map.h linux-2.6.7-abi/include/abi/util/map.h
26017 --- linux-2.6.7/include/abi/util/map.h 1970-01-01 01:00:00.000000000 +0100
26018 +++ linux-2.6.7-abi/include/abi/util/map.h 2004-07-22 17:44:21.000000000 +0200
26020 +#ifndef _ABI_MAP_H
26021 +#define _ABI_MAP_H
26026 + * Copyright (C) 1994 Mike Jagdis (jaggy@purplet.demon.co.uk)
26030 +struct map_segment {
26036 +static __inline u_short
26037 +map_flags(u_short f, u_short map[])
26039 + u_short m, r = 0;
26042 + for (i = 0, m = 1; i < 16; i++) {
26051 +static __inline long
26052 +map_bitvec(u_long vec, long map[])
26054 + u_long newvec = 0, m = 1;
26057 + for (i = 1; i <= 32; i++) {
26058 + if ((vec & m) && map[i] != -1)
26059 + newvec |= (1 << map[i]);
26066 +static __inline u_long
26067 +map_sigvec_from_kernel(sigset_t vec, u_long map[])
26069 + u_long newvec = 0;
26072 + for (i = 1; i <= 32; i++) {
26073 + if (sigismember(&vec, i) && map[i] != -1)
26074 + newvec |= (1 << map[i]);
26080 +static __inline sigset_t
26081 +map_sigvec_to_kernel(u_long vec, u_long map[])
26087 + sigemptyset(&newvec);
26088 + for (i = 1; i <= 32; i++) {
26089 + if ((vec & m) && map[i] != -1)
26090 + sigaddset(&newvec, map[i]);
26097 +static __inline int
26098 +map_value(struct map_segment *m, int val, int def)
26100 + struct map_segment *seg;
26103 + * If no mapping exists in this personality just return the
26104 + * number we were given.
26110 + * Search the map looking for a mapping for the given number.
26112 + for (seg = m; seg->start != -1; seg++) {
26113 + if (seg->start <= val && val <= seg->end) {
26115 + * If the start and end are the same then this
26116 + * segment has one entry and the map is the value
26117 + * it maps to. Otherwise if we have a vector we
26118 + * pick out the relevant value, if we don't have
26119 + * a vector we give identity mapping.
26121 + if (seg->start == seg->end)
26122 + return (int)seg->map;
26124 + return (seg->map ? seg->map[val-seg->start] : val);
26128 + /* Number isn't mapped. Returned the requested default. */
26132 +#endif /* ABI_MAP_H */
26133 diff -Nru linux-2.6.7/include/abi/util/revalidate.h linux-2.6.7-abi/include/abi/util/revalidate.h
26134 --- linux-2.6.7/include/abi/util/revalidate.h 1970-01-01 01:00:00.000000000 +0100
26135 +++ linux-2.6.7-abi/include/abi/util/revalidate.h 2004-07-22 17:44:21.000000000 +0200
26138 + * This is straight from linux/fs/stat.c.
26140 +#ifndef _ABI_UTIL_REVALIDATE_H
26141 +#define _ABI_UTIL_REVALIDATE_H
26145 +#include <linux/fs.h>
26147 +/* LINUXABI_TODO */
26149 + * This is required for proper NFS attribute caching (so it says there).
26150 + * Maybe the kernel should export it - but it is basically simple...
26152 +static __inline int
26153 +do_revalidate(struct dentry *dentry)
26155 + struct inode *inode = dentry->d_inode;
26156 + struct iattr attr;
26159 + attr.ia_valid = 0; /* setup an empty flag for the inode attribute change */
26161 + down(&inode->i_sem);
26162 + error = notify_change(dentry, &attr);
26163 + up(&inode->i_sem);
26167 +#endif /* _ABI_UTIL_REVALIDATE_H */
26168 diff -Nru linux-2.6.7/include/abi/util/socket.h linux-2.6.7-abi/include/abi/util/socket.h
26169 --- linux-2.6.7/include/abi/util/socket.h 1970-01-01 01:00:00.000000000 +0100
26170 +++ linux-2.6.7-abi/include/abi/util/socket.h 2004-07-22 17:44:21.000000000 +0200
26172 +#ifndef _ABI_UTIL_SOCKET_H
26173 +#define _ABI_UTIL_SOCKET_H
26176 + * These aren't (currently) defined by Linux. Watch out for warnings
26177 + * about redefinitions...
26179 +#define SO_USELOOPBACK 0xff02
26180 +#define SO_ORDREL 0xff03
26181 +#define SO_IMASOCKET 0xff04
26182 +#define SO_PROTOTYPE 0xff09
26184 +#endif /* _ABI_UTIL_SOCKET_H */
26185 diff -Nru linux-2.6.7/include/abi/util/stat.h linux-2.6.7-abi/include/abi/util/stat.h
26186 --- linux-2.6.7/include/abi/util/stat.h 1970-01-01 01:00:00.000000000 +0100
26187 +++ linux-2.6.7-abi/include/abi/util/stat.h 2004-07-22 17:44:21.000000000 +0200
26190 + * Mostly ripped from Al Viro's stat-a-AC9-10 patch, 2001 Christoph Hellwig.
26192 +#ifndef _ABI_UTIL_STAT_H
26193 +#define _ABI_UTIL_STAT_H
26198 +/* gone to ./include/linux/stat.h */
26212 + unsigned long blksize;
26213 + unsigned long blocks;
26218 +/* gone to ./include/linux/fs.h */
26219 +extern int vfs_stat(char *, struct kstat *);
26220 +extern int vfs_lstat(char *, struct kstat *);
26221 +extern int vfs_fstat(int, struct kstat *);
26224 +#endif /* _ABI_UTIL_STAT_H */
26225 diff -Nru linux-2.6.7/include/abi/util/sysent.h linux-2.6.7-abi/include/abi/util/sysent.h
26226 --- linux-2.6.7/include/abi/util/sysent.h 1970-01-01 01:00:00.000000000 +0100
26227 +++ linux-2.6.7-abi/include/abi/util/sysent.h 2004-07-22 17:44:21.000000000 +0200
26229 +#ifndef _ABI_SYSENT_H
26230 +#define _ABI_SYSENT_H
26235 +#include <asm/abi_machdep.h>
26241 + * This is needed for subdispatchers like cxenix().
26243 +extern void lcall7_dispatch(struct pt_regs *, struct sysent *, int);
26247 + * - If an entry is 'Ukn' we don't know how to handle it yet.
26248 + * - Spl means that we need to do special processing for this syscall.
26249 + * - Fast means that even the error return handling is done by the function.
26250 + * - Unimpl means the syscall is not implemented at all.
26253 + Spl = 0x65, /* pass the regs structure down */
26254 + Fast = 0x66, /* same as above + regs already setup at return */
26255 + Unimpl = 0x67, /* syscall is not implemented yet */
26256 + Ukn = Unimpl, /* source compat (XXX: kill me!) */
26260 + * Every entry in the systen tables is described by this structure.
26263 + void *se_syscall; /* function to call */
26264 + short se_nargs; /* number of aguments */
26267 + * Theses are only used for syscall tracing.
26269 + char *se_name; /* name of function */
26270 + char *se_args; /* how to print the argument list */
26274 + * Types for syscall pointers.
26276 +typedef int (*syscall_t)(struct pt_regs *);
26277 +typedef int (*syscallv_t)(void);
26278 +typedef int (*syscall1_t)(int);
26279 +typedef int (*syscall2_t)(int, int);
26280 +typedef int (*syscall3_t)(int, int, int);
26281 +typedef int (*syscall4_t)(int, int, int, int);
26282 +typedef int (*syscall5_t)(int, int, int, int, int);
26283 +typedef int (*syscall6_t)(int, int, int, int, int, int);
26284 +typedef int (*syscall7_t)(int, int, int, int, int, int, int);
26287 + * Marcos to call syscall pointers.
26289 +#define SYSCALL_VOID(sys) \
26290 + ((syscallv_t)(sys))();
26291 +#define SYSCALL_PREGS(sys, regs) \
26292 + ((syscall_t)(sys))((regs))
26293 +#define SYSCALL_1ARG(sys, args) \
26294 + ((syscall1_t)(sys))((args)[0])
26295 +#define SYSCALL_2ARG(sys, args) \
26296 + ((syscall2_t)(sys))((args)[0], (args)[1])
26297 +#define SYSCALL_3ARG(sys, args) \
26298 + ((syscall3_t)(sys))((args)[0], (args)[1], (args)[2])
26299 +#define SYSCALL_4ARG(sys, args) \
26300 + ((syscall4_t)(sys))((args)[0], (args)[1], (args)[2], (args)[3])
26301 +#define SYSCALL_5ARG(sys, args) \
26302 + ((syscall5_t)(sys))((args)[0], (args)[1], (args)[2], \
26303 + (args)[3], (args)[4])
26304 +#define SYSCALL_6ARG(sys, args) \
26305 + ((syscall6_t)(sys))((args)[0], (args)[1], (args)[2], \
26306 + (args)[3], (args)[4], (args)[5])
26307 +#define SYSCALL_7ARG(sys, args) \
26308 + ((syscall7_t)(sys))((args)[0], (args)[1], (args)[2], \
26309 + (args)[3], (args)[4], (args)[5], (args)[6])
26311 +#endif /* _ABI_SYSENT_H */
26312 diff -Nru linux-2.6.7/include/abi/util/trace.h linux-2.6.7-abi/include/abi/util/trace.h
26313 --- linux-2.6.7/include/abi/util/trace.h 1970-01-01 01:00:00.000000000 +0100
26314 +++ linux-2.6.7-abi/include/abi/util/trace.h 2004-07-22 17:44:21.000000000 +0200
26317 + * Copyright (c) 2001 Christoph Hellwig.
26318 + * All rights resered.
26320 + * This program is free software; you can redistribute it and/or modify
26321 + * it under the terms of the GNU General Public License as published by
26322 + * the Free Software Foundation; either version 2 of the License, or
26323 + * (at your option) any later version.
26325 + * This program is distributed in the hope that it will be useful,
26326 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
26327 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26328 + * GNU General Public License for more details.
26330 + * You should have received a copy of the GNU General Public License
26331 + * along with this program; if not, write to the Free Software
26332 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26334 +#ifndef _ABI_TRACE_H_
26335 +#define _ABI_TRACE_H_
26340 + * Linux-ABI tracing helpers.
26342 +#include <linux/types.h>
26349 + ABI_TRACE_API = 0x00000001, /* all call/return values */
26350 + ABI_TRACE_IOCTL = 0x00000002, /* all ioctl calls */
26351 + ABI_TRACE_IOCTL_F = 0x00000004, /* ioctl calls that fail */
26352 + ABI_TRACE_SIGNAL = 0x00000008, /* all signal calls */
26353 + ABI_TRACE_SIGNAL_F = 0x00000010, /* signal calls that fail */
26354 + ABI_TRACE_SOCKSYS = 0x00000020, /* socksys and spx devices */
26355 + ABI_TRACE_STREAMS = 0x00000040, /* STREAMS faking */
26356 + ABI_TRACE_UNIMPL = 0x00000100, /* unimplemened functions */
26358 +extern u_int abi_traceflg;
26362 + * Check if a syscall needs tracing.
26364 +#define abi_traced(res) (abi_traceflg & (res))
26367 + * Unconditinal trace.
26369 +#define __abi_trace(fmt...) \
26371 + printk(KERN_DEBUG "[%s:%d]: ", current->comm, current->pid); \
26376 + * Trace depending on reason.
26378 +#define abi_trace(res, fmt...) \
26380 + if (abi_traced(res)) \
26381 + __abi_trace(fmt); \
26384 +/* prototype for ./abi/util/plist.h */
26385 +extern void plist(char *, char *, int *);
26387 +#endif /* _ABI_TRACE_H_ */
26388 diff -Nru linux-2.6.7/include/abi/uw7/acl.h linux-2.6.7-abi/include/abi/uw7/acl.h
26389 --- linux-2.6.7/include/abi/uw7/acl.h 1970-01-01 01:00:00.000000000 +0100
26390 +++ linux-2.6.7-abi/include/abi/uw7/acl.h 2004-07-22 17:44:21.000000000 +0200
26392 +#ifndef _ABI_UW7_ACL_H
26393 +#define _ABI_UW7_ACL_H
26398 + * UnixWare 7 ACL bits (unused so far).
26410 + u_int16_t a_perm;
26414 +/* int uw7_acl(char * path, int cmd, int nentries, struct acl * aclp); */
26416 +#endif /* _ABI_UW7_ACL_H */
26417 diff -Nru linux-2.6.7/include/abi/uw7/context.h linux-2.6.7-abi/include/abi/uw7/context.h
26418 --- linux-2.6.7/include/abi/uw7/context.h 1970-01-01 01:00:00.000000000 +0100
26419 +++ linux-2.6.7-abi/include/abi/uw7/context.h 2004-07-22 17:44:21.000000000 +0200
26421 +#ifndef _ABI_UW7_CONTEXT_H
26422 +#define _ABI_UW7_CONTEXT_H
26427 + * UnixWare context bits.
26430 +/* ss_size <-> ss_flags which is why we can't use native Linux stack_t :( */
26431 +typedef struct uw7_stack {
26437 +/* XXX more registers, please */
26438 +typedef struct uw7_mcontext {
26439 + unsigned short gs, __gsh;
26440 + unsigned short fs, __fsh;
26441 + unsigned short es, __esh;
26442 + unsigned short ds, __dsh;
26445 +typedef struct uw7_sigset {
26446 + unsigned int sigbits[4];
26449 +typedef struct uw7_context {
26450 + unsigned long uc_flags;
26451 + struct uw7_context *uc_link;
26452 + uw7_sigset_t uc_sigmask;
26453 + uw7_stack_t uc_stack;
26454 + uw7_mcontext_t uc_mcontext;
26456 + char uc_unused[16];
26459 +#define UW7_GETCONTEXT 0
26460 +#define UW7_SETCONTEXT 1
26461 +#define UW7_GETXCONTEXT 2
26463 +#endif /* _ABI_UW7_CONTEXT_H */
26464 diff -Nru linux-2.6.7/include/abi/uw7/resource.h linux-2.6.7-abi/include/abi/uw7/resource.h
26465 --- linux-2.6.7/include/abi/uw7/resource.h 1970-01-01 01:00:00.000000000 +0100
26466 +++ linux-2.6.7-abi/include/abi/uw7/resource.h 2004-07-22 17:44:21.000000000 +0200
26468 +#ifndef _ABI_UW7_RESOURCE_H
26469 +#define _ABI_UW7_RESOURCE_H
26474 + * UnixWare 7 resource limit handling.
26477 +typedef u_int64_t uw7_rlim64_t;
26479 +struct uw7_rlim64 {
26480 + uw7_rlim64_t rlim_cur; /* current limit */
26481 + uw7_rlim64_t rlim_max; /* maximum value for rlim_cur */
26485 + UW7_RLIMIT_CPU = 0, /* cpu time in milliseconds */
26486 + UW7_RLIMIT_FSIZE = 1, /* maximum file size */
26487 + UW7_RLIMIT_DATA = 2, /* data size */
26488 + UW7_RLIMIT_STACK = 3, /* stack size */
26489 + UW7_RLIMIT_CORE = 4, /* core file size */
26490 + UW7_RLIMIT_NOFILE = 5, /* file descriptors */
26491 + UW7_RLIMIT_VMEM = 6, /* maximum mapped memory */
26494 +static int uw7_to_linux_rlimit[] = {
26503 +#endif /* _ABI_UW7_RESOURCE_H */
26504 diff -Nru linux-2.6.7/include/abi/uw7/stat.h linux-2.6.7-abi/include/abi/uw7/stat.h
26505 --- linux-2.6.7/include/abi/uw7/stat.h 1970-01-01 01:00:00.000000000 +0100
26506 +++ linux-2.6.7-abi/include/abi/uw7/stat.h 2004-07-22 17:44:21.000000000 +0200
26508 +#ifndef _ABI_UW7_STAT_H
26509 +#define _ABI_UW7_STAT_H
26514 +#include <abi/uw7/types.h>
26516 +struct uw7_stat64 {
26517 + uw7_dev_t st_dev;
26518 + u_int32_t st_pad1[3];
26519 + uw7_ino_t st_ino;
26520 + uw7_mode_t st_mode;
26521 + uw7_nlink_t st_nlink;
26522 + uw7_uid_t st_uid;
26523 + uw7_gid_t st_gid;
26524 + uw7_dev_t st_rdev;
26525 + u_int32_t st_pad2[2];
26526 + uw7_off_t st_size;
26527 + struct timeval st_atime;
26528 + struct timeval st_mtime;
26529 + struct timeval st_ctime;
26530 + int32_t st_blksize;
26531 + int64_t st_blocks;
26532 + char st_fstype[16];
26533 + int32_t st_aclcnt;
26534 + u_int32_t st_level;
26535 + u_int32_t st_flags;
26536 + u_int32_t st_cmwlevel;
26537 + u_int32_t st_pad4[4];
26540 +#endif /* _ABI_UW7_STAT_H */
26541 diff -Nru linux-2.6.7/include/abi/uw7/statvfs.h linux-2.6.7-abi/include/abi/uw7/statvfs.h
26542 --- linux-2.6.7/include/abi/uw7/statvfs.h 1970-01-01 01:00:00.000000000 +0100
26543 +++ linux-2.6.7-abi/include/abi/uw7/statvfs.h 2004-07-22 17:44:21.000000000 +0200
26545 +#ifndef _ABI_UW7_STATVFS_H
26546 +#define _ABI_UW7_STATVFS_H
26550 +#include <abi/uw7/types.h>
26553 +struct uw7_statvfs64 {
26554 + u_int32_t f_bsize; /* file system block size */
26555 + u_int32_t f_frsize; /* file system fragment size */
26556 + uw7_fsblkcnt64_t f_blocks; /* total # of fragments */
26557 + uw7_fsblkcnt64_t f_bfree; /* total # of free fragments */
26558 + uw7_fsblkcnt64_t f_bavail; /* # of free fragments avail */
26559 + uw7_fsfilcnt64_t f_files; /* total # of inodes */
26560 + uw7_fsfilcnt64_t f_ffree; /* total # of free inodes */
26561 + uw7_fsfilcnt64_t f_favail; /* # of free inodes avail */
26562 + u_int32_t f_fsid; /* file system id */
26563 + char f_basetype[16]; /* target fs type name */
26564 + u_int32_t f_flag; /* bit-mask of flags */
26565 + u_int32_t f_namemax; /* maximum file name length */
26566 + char f_fstr[32]; /* filesystem string */
26567 + u_int32_t f_filler[16]; /* reserved */
26570 +#endif /* _ABI_UW7_STATVFS_H */
26571 diff -Nru linux-2.6.7/include/abi/uw7/sysent.h linux-2.6.7-abi/include/abi/uw7/sysent.h
26572 --- linux-2.6.7/include/abi/uw7/sysent.h 1970-01-01 01:00:00.000000000 +0100
26573 +++ linux-2.6.7-abi/include/abi/uw7/sysent.h 2004-07-22 17:44:21.000000000 +0200
26575 +#ifndef _ABI_UW7_SYSENT_H
26576 +#define _ABI_UW7_SYSENT_H
26581 + * External function declarations for the SCO UnixWare 7 syscall table.
26585 +struct uw7_rlimit64;
26587 +struct uw7_statvfs64;
26591 +extern int uw7_access(char *, int);
26594 +extern int uw7_context(struct pt_regs *);
26595 +extern int uw7_sigaltstack(const struct uw7_stack *, struct uw7_stack *);
26598 +extern int uw7_sleep(int);
26599 +extern int uw7_seteuid(int);
26600 +extern int uw7_setegid(int);
26601 +extern int uw7_pread(u_int, char *, int, long);
26602 +extern int uw7_pwrite(u_int, char *, int, long);
26603 +extern int uw7_stty(int, int);
26604 +extern int uw7_gtty(int, int);
26607 +extern int uw7_ioctl(struct pt_regs *);
26610 +extern int uw7_truncate64(const char *, u_long, u_long);
26611 +extern int uw7_ftruncate64(int, u_long, u_long);
26612 +extern int uw7_statvfs64(char *, struct uw7_statvfs64 *);
26613 +extern int uw7_fstatvfs64(int, struct uw7_statvfs64 *);
26614 +extern int uw7_getrlimit64(int, struct uw7_rlimit64 *);
26615 +extern int uw7_setrlimit64(int, const struct uw7_rlimit64 *);
26616 +extern int uw7_lseek64(int, u_int, u_int, int);
26617 +extern ssize_t uw7_pread64(int, char *, int, u_int, u_int);
26618 +extern ssize_t uw7_pwrite64(int, char *, int, u_int, u_int);
26619 +extern int uw7_creat64(const char *, int);
26622 +extern int uw7_mldmode(int);
26625 +extern int uw7_mmap64(u_long, size_t, int, int, int, u_long, u_long);
26628 +extern int uw7_xstat(int, char *, void *);
26629 +extern int uw7_lxstat(int, char *, void *);
26630 +extern int uw7_fxstat(int, int, void *);
26632 +#endif /* _ABI_UW7_SYSENT_H */
26633 diff -Nru linux-2.6.7/include/abi/uw7/termbits.h linux-2.6.7-abi/include/abi/uw7/termbits.h
26634 --- linux-2.6.7/include/abi/uw7/termbits.h 1970-01-01 01:00:00.000000000 +0100
26635 +++ linux-2.6.7-abi/include/abi/uw7/termbits.h 2004-07-22 17:44:21.000000000 +0200
26637 +#ifndef _ABI_UW7_TERMBITS_H
26638 +#define _ABI_UW7_TERMBITS_H
26640 +#define UW7_TIOC ('T'<<8)
26641 +#define UW7_TCGETA (UW7_TIOC|1)
26642 +#define UW7_TCSETA (UW7_TIOC|2)
26643 +#define UW7_TCSETAW (UW7_TIOC|3)
26644 +#define UW7_TCSETAF (UW7_TIOC|4)
26645 +#define UW7_TCSBRK (UW7_TIOC|5)
26646 +#define UW7_TCXONC (UW7_TIOC|6)
26647 +#define UW7_TCFLSH (UW7_TIOC|7)
26648 +#define UW7_TCDSET (UW7_TIOC|32)
26649 +#define UW7_RTS_TOG (UW7_TIOC|33)
26650 +#define UW7_TIOCGWINSZ (UW7_TIOC|104)
26651 +#define UW7_TIOCSWINSZ (UW7_TIOC|103)
26652 +#define UW7_TCGETS (UW7_TIOC|13)
26653 +#define UW7_TCSETS (UW7_TIOC|14)
26654 +#define UW7_TCSANOW UW7_TCSETS
26655 +#define UW7_TCSETSW (UW7_TIOC|15)
26656 +#define UW7_TCSADRAIN UW7_TCSETSW
26657 +#define UW7_TCSETSF (UW7_TIOC|16)
26658 +#define UW7_TCSAFLUSH UW7_TCSETSF
26661 + * VEOF/VEOL and VMIN/VTIME are overloaded.
26662 + * VEOF/VEOL are used in canonical mode (ICANON),
26663 + * otherwise VMIN/VTIME are used.
26665 +#define UW7_VINTR 0
26666 +#define UW7_VQUIT 1
26667 +#define UW7_VERASE 2
26668 +#define UW7_VKILL 3
26669 +#define UW7_VEOF 4
26670 +#define UW7_VEOL 5
26671 +#define UW7_VEOL2 6
26672 +#define UW7_VMIN 4
26673 +#define UW7_VTIME 5
26674 +#define UW7_VSWTCH 7
26675 +#define UW7_VSTART 8
26676 +#define UW7_VSTOP 9
26677 +#define UW7_VSUSP 10
26678 +#define UW7_VDSUSP 11
26679 +#define UW7_VREPRINT 12
26680 +#define UW7_VDISCARD 13
26681 +#define UW7_VWERASE 14
26682 +#define UW7_VLNEXT 15
26685 + * Input modes (c_iflag), same as Linux bits, except DOSMODE (obsolete).
26687 +#define UW7_IFLAG_MSK 0017777
26688 +#define UW7_IGNBRK 0000001
26689 +#define UW7_BRKINT 0000002
26690 +#define UW7_IGNPAR 0000004
26691 +#define UW7_PARMRK 0000010
26692 +#define UW7_INPCK 0000020
26693 +#define UW7_ISTRIP 0000040
26694 +#define UW7_INLCR 0000100
26695 +#define UW7_IGNCR 0000200
26696 +#define UW7_ICRNL 0000400
26697 +#define UW7_IUCLC 0001000
26698 +#define UW7_IXON 0002000
26699 +#define UW7_IXANY 0004000
26700 +#define UW7_IXOFF 0010000
26701 +#define UW7_IMAXBEL 0020000
26702 +#define UW7_DOSMODE 0100000
26705 + * Output modes (c_oflag), exactly the same as Linux bits.
26707 +#define UW7_OFLAG_MSK 0177777
26708 +#define UW7_OPOST 0000001
26709 +#define UW7_OLCUC 0000002
26710 +#define UW7_ONLCR 0000004
26711 +#define UW7_OCRNL 0000010
26712 +#define UW7_ONOCR 0000020
26713 +#define UW7_ONLRET 0000040
26714 +#define UW7_OFILL 0000100
26715 +#define UW7_OFDEL 0000200
26716 +#define UW7_NLDLY 0000400
26717 +#define UW7_NL0 0000000
26718 +#define UW7_NL1 0000400
26719 +#define UW7_CRDLY 0003000
26720 +#define UW7_CR0 0000000
26721 +#define UW7_CR1 0001000
26722 +#define UW7_CR2 0002000
26723 +#define UW7_CR3 0003000
26724 +#define UW7_TABDLY 0014000
26725 +#define UW7_TAB0 0000000
26726 +#define UW7_TAB1 0004000
26727 +#define UW7_TAB2 0010000
26728 +#define UW7_TAB3 0014000
26729 +#define UW7_XTABS UW7_TAB3
26730 +#define UW7_BSDLY 0020000
26731 +#define UW7_BS0 0000000
26732 +#define UW7_BS1 0020000
26733 +#define UW7_VTDLY 0040000
26734 +#define UW7_VT0 0000000
26735 +#define UW7_VT1 0040000
26736 +#define UW7_FFDLY 0100000
26737 +#define UW7_FF0 0000000
26738 +#define UW7_FF1 0100000
26741 + * Control modes (c_cflag).
26743 +#define UW7_CFLAG_MSK 0177777
26744 +#define UW7_CBAUD 0000017
26745 +#define UW7_CSIZE 0000060
26746 +#define UW7_CS5 0000000
26747 +#define UW7_CS6 0000020
26748 +#define UW7_CS7 0000040
26749 +#define UW7_CS8 0000060
26750 +#define UW7_CSTOPB 0000100
26751 +#define UW7_CREAD 0000200
26752 +#define UW7_PARENB 0000400
26753 +#define UW7_PARODD 0001000
26754 +#define UW7_HUPCL 0002000
26755 +#define UW7_CLOCAL 0004000
26756 +#define UW7_XCLUDE 0100000
26757 +#define UW7_CIBAUD 000003600000
26758 +#define UW7_IBSHIFT 16
26759 +#define UW7_PAREXT 000004000000
26762 + * Local modes (c_lflag), same as Linux except
26763 + * UW7_FLUSHO is different and UW7_DEFECHO is obsolete (set to 0).
26765 +#define UW7_LFLAG_MSK 0001777
26766 +#define UW7_ISIG 0000001
26767 +#define UW7_ICANON 0000002
26768 +#define UW7_XCASE 0000004
26769 +#define UW7_ECHO 0000010
26770 +#define UW7_ECHOE 0000020
26771 +#define UW7_ECHOK 0000040
26772 +#define UW7_ECHONL 0000100
26773 +#define UW7_NOFLSH 0000200
26774 +#define UW7_TOSTOP 0000400
26775 +#define UW7_ECHOCTL 0001000
26776 +#define UW7_ECHOPRT 0002000
26777 +#define UW7_ECHOKE 0004000
26778 +#define UW7_DEFECHO 0010000
26779 +#define UW7_FLUSHO 0020000
26780 +#define UW7_PENDIN 0040000
26781 +#define UW7_IEXTEN 0100000
26783 +#endif /* _ABI_UW7_TERMBITS_H */
26784 diff -Nru linux-2.6.7/include/abi/uw7/termios.h linux-2.6.7-abi/include/abi/uw7/termios.h
26785 --- linux-2.6.7/include/abi/uw7/termios.h 1970-01-01 01:00:00.000000000 +0100
26786 +++ linux-2.6.7-abi/include/abi/uw7/termios.h 2004-07-22 17:44:21.000000000 +0200
26788 +#ifndef _ABI_UW7_TERMIOS_H
26789 +#define _ABI_UW7_TERMIOS_H
26791 +#define UW7_NCCS (19)
26792 +struct uw7_termios {
26793 + unsigned long c_iflag;
26794 + unsigned long c_oflag;
26795 + unsigned long c_cflag;
26796 + unsigned long c_lflag;
26797 + unsigned char c_cc[UW7_NCCS];
26800 +#endif /* _ABI_UW7_TERMIOS_H */
26801 diff -Nru linux-2.6.7/include/abi/uw7/types.h linux-2.6.7-abi/include/abi/uw7/types.h
26802 --- linux-2.6.7/include/abi/uw7/types.h 1970-01-01 01:00:00.000000000 +0100
26803 +++ linux-2.6.7-abi/include/abi/uw7/types.h 2004-07-22 17:44:21.000000000 +0200
26806 + * Copyright (c) 2001 Christoph Hellwig.
26807 + * All rights reserved.
26809 + * This program is free software; you can redistribute it and/or modify
26810 + * it under the terms of the GNU General Public License as published by
26811 + * the Free Software Foundation; either version 2 of the License, or
26812 + * (at your option) any later version.
26814 + * This program is distributed in the hope that it will be useful,
26815 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
26816 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26817 + * GNU General Public License for more details.
26819 + * You should have received a copy of the GNU General Public License
26820 + * along with this program; if not, write to the Free Software
26821 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26823 +#ifndef _ABI_UW7_TYPES_H
26824 +#define _ABI_UW7_TYPES_H
26829 + * UnixWare 7 type declarations.
26831 +#include <abi/svr4/types.h> /* UnixWare is based on SVR4 */
26833 +typedef svr4_dev_t uw7_dev_t;
26834 +typedef u_int64_t uw7_ino_t;
26835 +typedef svr4_mode_t uw7_mode_t;
26836 +typedef svr4_nlink_t uw7_nlink_t;
26837 +typedef svr4_uid_t uw7_uid_t;
26838 +typedef svr4_gid_t uw7_gid_t;
26839 +typedef int64_t uw7_off_t;
26840 +typedef struct timeval uw7_timestruc_t;
26842 +typedef u_int64_t uw7_fsblkcnt64_t;
26843 +typedef u_int64_t uw7_fsfilcnt64_t;
26846 +#define linux_to_uw7_dev_t(dev) \
26847 + linux_to_svr4_dev_t(dev)
26849 +#define linux_to_uw7_ino_t(ino) \
26850 + linux_to_svr4_ino_t(ino)
26852 +#define linux_to_uw7_uid_t(uid) \
26853 + linux_to_svr4_uid_t(uid)
26855 +#define linux_to_uw7_gid_t(gid) \
26856 + linux_to_svr4_gid_t(gid)
26858 +#endif /* _ABI_UW7_TYPES_H */
26859 diff -Nru linux-2.6.7/include/abi/wyse/net.h linux-2.6.7-abi/include/abi/wyse/net.h
26860 --- linux-2.6.7/include/abi/wyse/net.h 1970-01-01 01:00:00.000000000 +0100
26861 +++ linux-2.6.7-abi/include/abi/wyse/net.h 2004-07-22 17:44:21.000000000 +0200
26864 + * Copyright (C) 1994 Mike Jagdis (jaggy@purplet.demon.co.uk)
26870 + * Wyse extensions for 4.3 BSD TCP/IP in V/386 3.2.1A
26872 +#include <linux/ioctl.h>
26874 +/* Get struct rtentry from linux/route.h - this should be compatible. */
26875 +#include <linux/route.h>
26876 +/* Get struct arpreq from linux/if_arp.h - this should be compatible. */
26877 +#include <linux/if_arp.h>
26878 +/* Get struct ifreq and struct ifconf from linux/if.h - these should
26879 + * be compatible. */
26880 +#include <linux/if.h>
26883 +/* Wyse use BSD style ioctls. This will warn us if we haven't got compatible
26884 + * structures :-).
26887 +/* socket i/o controls */
26888 +#define WVR3_SIOCSHIWAT BSD__IOW('s', 0, int) /* set high watermark */
26889 +#define WVR3_SIOCGHIWAT BSD__IOR('s', 1, int) /* get high watermark */
26890 +#define WVR3_SIOCSLOWAT BSD__IOW('s', 2, int) /* set low watermark */
26891 +#define WVR3_SIOCGLOWAT BSD__IOR('s', 3, int) /* get low watermark */
26892 +#define WVR3_SIOCATMARK BSD__IOR('s', 7, int) /* at oob mark? */
26893 +#define WVR3_SIOCSPGRP BSD__IOW('s', 8, int) /* set process group */
26894 +#define WVR3_SIOCGPGRP BSD__IOR('s', 9, int) /* get process group */
26896 +#define WVR3_SIOCADDRT BSD__IOW('r', 10, struct rtentry) /* add route */
26897 +#define WVR3_SIOCDELRT BSD__IOW('r', 11, struct rtentry) /* delete route */
26899 +#define WVR3_SIOCSIFADDR BSD__IOW('i', 12, struct ifreq) /* set ifnet address */
26900 +#define WVR3_SIOCGIFADDR BSD__IOWR('i',13, struct ifreq) /* get ifnet address */
26901 +#define WVR3_SIOCSIFDSTADDR BSD__IOW('i', 14, struct ifreq) /* set p-p address */
26902 +#define WVR3_SIOCGIFDSTADDR BSD__IOWR('i',15, struct ifreq) /* get p-p address */
26903 +#define WVR3_SIOCSIFFLAGS BSD__IOW('i', 16, struct ifreq) /* set ifnet flags */
26904 +#define WVR3_SIOCGIFFLAGS BSD__IOWR('i',17, struct ifreq) /* get ifnet flags */
26905 +#define WVR3_SIOCGIFBRDADDR BSD__IOWR('i',18, struct ifreq) /* get broadcast addr */
26906 +#define WVR3_SIOCSIFBRDADDR BSD__IOW('i',19, struct ifreq) /* set broadcast addr */
26907 +#define WVR3_SIOCGIFCONF BSD__IOWR('i',20, struct ifconf) /* get ifnet list */
26908 +#define WVR3_SIOCGIFNETMASK BSD__IOWR('i',21, struct ifreq) /* get net addr mask */
26909 +#define WVR3_SIOCSIFNETMASK BSD__IOW('i',22, struct ifreq) /* set net addr mask */
26910 +#define WVR3_SIOCGIFMETRIC BSD__IOWR('i',23, struct ifreq) /* get IF metric */
26911 +#define WVR3_SIOCSIFMETRIC BSD__IOW('i',24, struct ifreq) /* set IF metric */
26912 +#define WVR3_SIOCSIFHADDR BSD__IOW('i', 25, struct ifreq) /* set hardware addr */
26913 +#define WVR3_SIOCGIFHADDR BSD__IOWR('i',26, struct ifreq) /* get hardware addr */
26914 +#define WVR3_SIOCRIFHADDR BSD__IOW('i', 27, struct ifreq) /* reset hardware addr */
26916 +#define WVR3_SIOCSARP BSD__IOW('i', 30, struct arpreq) /* set arp entry */
26917 +#define WVR3_SIOCGARP BSD__IOWR('i',31, struct arpreq) /* get arp entry */
26918 +#define WVR3_SIOCDARP BSD__IOW('i', 32, struct arpreq) /* delete arp entry */
26920 +#define WVR3_SIOCADDMULTI BSD__IOW('i', 33, struct ifreq) /* set multicast addr */
26921 +#define WVR3_SIOCDELMULTI BSD__IOW('i', 34, struct ifreq) /* set multicast addr */
26922 diff -Nru linux-2.6.7/include/abi/wyse/sysent.h linux-2.6.7-abi/include/abi/wyse/sysent.h
26923 --- linux-2.6.7/include/abi/wyse/sysent.h 1970-01-01 01:00:00.000000000 +0100
26924 +++ linux-2.6.7-abi/include/abi/wyse/sysent.h 2004-07-22 17:44:21.000000000 +0200
26927 + * Copyright (c) 2001 Christoph Hellwig.
26928 + * All rights reserved.
26930 + * This program is free software; you can redistribute it and/or modify
26931 + * it under the terms of the GNU General Public License as published by
26932 + * the Free Software Foundation; either version 2 of the License, or
26933 + * (at your option) any later version.
26935 + * This program is distributed in the hope that it will be useful,
26936 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
26937 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26938 + * GNU General Public License for more details.
26940 + * You should have received a copy of the GNU General Public License
26941 + * along with this program; if not, write to the Free Software
26942 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26944 +#ifndef _ABI_WYSE_SYSENT_H
26945 +#define _ABI_WYSE_SYSENT_H
26950 + * External function declarations for the Wyse V/386 syscall table.
26957 +extern int wyse_ptrace(int, int, u_long, u_long);
26960 +extern int wyse_gethostname(char *, int);
26961 +extern int wyse_getdomainname(char *, int);
26962 +extern int wyse_wait3(int *);
26963 +extern int wyse_socket(int, int, int);
26964 +extern int wyse_setsockopt(int, int, int, char *, int);
26965 +extern int wyse_getsockopt(int, int, int, char *, int *);
26966 +extern int wyse_recvfrom(int, void *, size_t, unsigned,
26967 + struct sockaddr *, int *);
26968 +extern int wyse_recv(int, void *, size_t, unsigned);
26969 +extern int wyse_sendto(int, void *, size_t, unsigned,
26970 + struct sockaddr *, int);
26971 +extern int wyse_send(int, void *, size_t, unsigned);
26974 +extern int wyse_syslocal(struct pt_regs *);
26976 +#endif /* _ABI_WYSE_SYSENT_H */
26977 diff -Nru linux-2.6.7/include/asm-i386/abi_machdep.h linux-2.6.7-abi/include/asm-i386/abi_machdep.h
26978 --- linux-2.6.7/include/asm-i386/abi_machdep.h 1970-01-01 01:00:00.000000000 +0100
26979 +++ linux-2.6.7-abi/include/asm-i386/abi_machdep.h 2004-07-22 17:44:21.000000000 +0200
26982 + * Copyright (c) 2001 Caldera Deutschland GmbH.
26983 + * Copyright (c) 2001 Christoph Hellwig.
26984 + * All rights reserved.
26986 + * This program is free software; you can redistribute it and/or modify
26987 + * it under the terms of the GNU General Public License as published by
26988 + * the Free Software Foundation; either version 2 of the License, or
26989 + * (at your option) any later version.
26991 + * This program is distributed in the hope that it will be useful,
26992 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
26993 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26994 + * GNU General Public License for more details.
26996 + * You should have received a copy of the GNU General Public License
26997 + * along with this program; if not, write to the Free Software
26998 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27000 +#ifndef _ASM_ABI_MACHDEP_H
27001 +#define _ASM_ABI_MACHDEP_H
27003 +#include <linux/ptrace.h>
27006 + * get_syscall_parameter - get syscall parameter
27007 + * @regs: saved register contents
27008 + * @n: nth syscall to get
27010 + * This function gets the nth syscall parameter if
27011 + * the syscall got a &struct pt_regs * passed instead
27012 + * of the traditional C calling convention.
27014 +static __inline unsigned long
27015 +get_syscall_parameter(struct pt_regs *regs, int n)
27019 + __get_user(r, ((unsigned long *)regs->esp)+(n+1));
27024 + * set_error - set error number
27025 + * @regs: saved register contents
27026 + * @errno: error number
27028 + * This function sets the syscall error return for lcall7
27029 + * calling conventions to @errno.
27031 +static __inline void
27032 +set_error(struct pt_regs *regs, int errno)
27034 + regs->eax = errno;
27035 + regs->eflags |= 1;
27039 + * clear_error - clear error return flag
27040 + * @regs: saved register contents
27042 + * This funtion clears the flag that indicates an error
27043 + * return for lcall7-based syscalls.
27045 +static __inline void
27046 +clear_error(struct pt_regs *regs)
27048 + regs->eflags &= ~1;
27052 + * set_result - set syscall return value
27053 + * @regs: saved register contents
27055 + * This funtion sets the return value for syscalls
27056 + * that have the saved register set calling convention.
27058 +static __inline void
27059 +set_result(struct pt_regs *regs, int r)
27065 + * get_result - get syscall return value
27066 + * @regs: saved register contents
27068 + * This funtion gets the return value for syscalls
27069 + * that have the saved register set calling convention.
27071 +static __inline int
27072 +get_result(struct pt_regs *regs)
27074 + return regs->eax;
27077 +#endif /* _ASM_ABI_MACHDEP_H */
27078 diff -Nru linux-2.6.7/include/asm-i386/elf.h linux-2.6.7-abi/include/asm-i386/elf.h
27079 --- linux-2.6.7/include/asm-i386/elf.h 2004-06-16 07:19:42.000000000 +0200
27080 +++ linux-2.6.7-abi/include/asm-i386/elf.h 2004-07-22 17:44:21.000000000 +0200
27081 @@ -117,7 +117,20 @@
27082 #define AT_SYSINFO_EHDR 33
27085 -#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
27087 +#include <asm/elfmark.h>
27089 +#define SET_PERSONALITY(ex, ibcs2) \
27091 + unsigned long personality = abi_defhandler_elf; \
27092 + if ((ex).e_flags == EF_386_UW7) \
27093 + personality = PER_UW7; \
27094 + else if ((ex).e_flags == EF_386_OSR5) \
27095 + personality = PER_OSR5; \
27096 + else if (ibcs2) \
27097 + personality = abi_defhandler_libcso; \
27098 + set_personality(personality); \
27101 extern int dump_task_regs (struct task_struct *, elf_gregset_t *);
27102 extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *);
27103 diff -Nru linux-2.6.7/include/asm-i386/elfmark.h linux-2.6.7-abi/include/asm-i386/elfmark.h
27104 --- linux-2.6.7/include/asm-i386/elfmark.h 1970-01-01 01:00:00.000000000 +0100
27105 +++ linux-2.6.7-abi/include/asm-i386/elfmark.h 2004-07-22 17:44:21.000000000 +0200
27108 + * elfmark - set ELF header e_flags value to an abi-specific value.
27110 + * This utility is used for marking ELF binaries (including shared libraries)
27111 + * for use by the UW Linux kernel module that provides exec domain for PER_UW7
27112 + * personality. Run only on IA32 architectures.
27114 + * Authors - Tigran Aivazian <tigran@veritas.com>,
27115 + * Christoph Hellwig <hch@caldera.de>
27117 + * This software is under GPL
27119 +#ifndef _ELFMARK_H
27120 +#define _ELFMARK_H
27123 + * The e_flags value for SCO UnixWare 7/UDK binaries
27125 +#ifndef EF_386_UW7
27126 +#define EF_386_UW7 0x314B4455
27130 + * The e_flags value for SCO OpenServer 5 binaries.
27132 +#ifndef EF_386_OSR5
27133 +#define EF_386_OSR5 0x3552534f
27137 + * e_flags value with no special meaning.
27139 +#ifndef EF_386_NONE
27140 +#define EF_386_NONE 0
27143 +#endif /* _ELFMARK_H */
27144 diff -Nru linux-2.6.7/include/asm-i386/namei.h linux-2.6.7-abi/include/asm-i386/namei.h
27145 --- linux-2.6.7/include/asm-i386/namei.h 2004-06-16 07:19:43.000000000 +0200
27146 +++ linux-2.6.7-abi/include/asm-i386/namei.h 2004-07-22 17:44:21.000000000 +0200
27150 * linux/include/asm-i386/namei.h
27152 * Included from linux/fs/namei.c
27154 #ifndef __I386_NAMEI_H
27155 #define __I386_NAMEI_H
27157 -/* This dummy routine maybe changed to something useful
27158 - * for /usr/gnemul/ emulation stuff.
27159 - * Look at asm-sparc/namei.h for details.
27160 +#include <linux/config.h>
27163 + * The base directory for our emulations.
27164 + * - sparc uses usr/gmemul here.
27166 +#define I386_EMUL_BASE "emul/"
27169 + * We emulate quite a lot operting systems...
27171 +#define I386_SVR4_EMUL I386_EMUL_BASE "/svr4/"
27172 +#define I386_SVR3_EMUL I386_EMUL_BASE "/svr3/"
27173 +#define I386_SCOSVR3_EMUL I386_EMUL_BASE "/sco/"
27174 +#define I386_OSR5_EMUL I386_EMUL_BASE "/osr5/"
27175 +#define I386_WYSEV386_EMUL I386_EMUL_BASE "/wyse/"
27176 +#define I386_ISCR4_EMUL I386_EMUL_BASE "/isc/"
27177 +#define I386_BSD_EMUL I386_EMUL_BASE "/bsd/"
27178 +#define I386_XENIX_EMUL I386_EMUL_BASE "/xenix/"
27179 +#define I386_SOLARIS_EMUL I386_EMUL_BASE "/solaris/"
27180 +#define I386_UW7_EMUL I386_EMUL_BASE "/uw7/"
27182 -#define __emul_prefix() NULL
27183 +static inline char *__emul_prefix(void)
27185 +#if defined(CONFIG_ABI) || defined (CONFIG_ABI_MODULE)
27186 + switch (get_cur_personality()) {
27188 + return I386_SVR4_EMUL;
27190 + return I386_SVR3_EMUL;
27191 + case PER_SCOSVR3:
27192 + return I386_SCOSVR3_EMUL;
27194 + return I386_OSR5_EMUL;
27195 + case PER_WYSEV386:
27196 + return I386_WYSEV386_EMUL;
27198 + return I386_ISCR4_EMUL;
27200 + return I386_BSD_EMUL;
27202 + return I386_XENIX_EMUL;
27203 + case PER_SOLARIS:
27204 + return I386_SOLARIS_EMUL;
27206 + return I386_UW7_EMUL;
27208 +#endif /* CONFIG_ABI || CONFIG_ABI_MODULE */
27212 #endif /* __I386_NAMEI_H */
27213 diff -Nru linux-2.6.7/include/asm-i386/unistd.h linux-2.6.7-abi/include/asm-i386/unistd.h
27214 --- linux-2.6.7/include/asm-i386/unistd.h 2004-06-16 07:19:37.000000000 +0200
27215 +++ linux-2.6.7-abi/include/asm-i386/unistd.h 2004-07-22 17:44:21.000000000 +0200
27216 @@ -412,6 +412,7 @@
27217 #include <linux/types.h>
27218 #include <linux/linkage.h>
27219 #include <asm/ptrace.h>
27220 +#include <asm/signal.h> /* for old_sigset_t */
27223 * we need this inline - forking from kernel space will result
27224 @@ -451,7 +452,11 @@
27225 const struct sigaction __user *act,
27226 struct sigaction __user *oact,
27227 size_t sigsetsize);
27229 +extern asmlinkage int sys_ipc(uint call, int first, int second,
27230 + int third, void *ptr, long fifth);
27231 +extern asmlinkage long sys_sigaltstack(const stack_t *uss, stack_t *uoss);
27232 +extern asmlinkage int sys_sigsuspend(int history0, int history1,
27233 + old_sigset_t mask);
27237 diff -Nru linux-2.6.7/include/asm-parisc/processor.h linux-2.6.7-abi/include/asm-parisc/processor.h
27238 --- linux-2.6.7/include/asm-parisc/processor.h 2004-06-16 07:20:26.000000000 +0200
27239 +++ linux-2.6.7-abi/include/asm-parisc/processor.h 2004-07-22 17:44:21.000000000 +0200
27240 @@ -262,7 +262,7 @@
27244 -#define USER_WIDE_MODE (personality(current->personality) == PER_LINUX)
27245 +#define USER_WIDE_MODE (is_cur_personality_id(PERID_LINUX))
27247 #define USER_WIDE_MODE 0
27249 diff -Nru linux-2.6.7/include/linux/fs.h linux-2.6.7-abi/include/linux/fs.h
27250 --- linux-2.6.7/include/linux/fs.h 2004-06-16 07:19:02.000000000 +0200
27251 +++ linux-2.6.7-abi/include/linux/fs.h 2004-07-22 17:44:21.000000000 +0200
27252 @@ -1474,6 +1474,18 @@
27254 extern int vfs_readdir(struct file *, filldir_t, void *);
27257 +struct old_linux_dirent {
27258 + unsigned long d_ino;
27259 + unsigned long d_offset;
27260 + unsigned short d_namlen;
27264 +extern asmlinkage long old_readdir(unsigned int fd,
27265 + struct old_linux_dirent __user * dirent, unsigned int count);
27268 extern int vfs_stat(char __user *, struct kstat *);
27269 extern int vfs_lstat(char __user *, struct kstat *);
27270 extern int vfs_fstat(unsigned int, struct kstat *);
27271 diff -Nru linux-2.6.7/include/linux/major.h linux-2.6.7-abi/include/linux/major.h
27272 --- linux-2.6.7/include/linux/major.h 2004-06-16 07:19:02.000000000 +0200
27273 +++ linux-2.6.7-abi/include/linux/major.h 2004-07-22 17:44:21.000000000 +0200
27275 #define ACSI_MAJOR 28
27276 #define AZTECH_CDROM_MAJOR 29
27277 #define GRAPHDEV_MAJOR 29 /* SparcLinux & Linux/68k /dev/fb */
27278 +#define SOCKSYS_MAJOR 30 /* iBCS needs this for STREAMS-based TCP/IP */
27279 #define CM206_CDROM_MAJOR 32
27280 #define IDE2_MAJOR 33
27281 #define IDE3_MAJOR 34
27282 diff -Nru linux-2.6.7/include/linux/personality.h linux-2.6.7-abi/include/linux/personality.h
27283 --- linux-2.6.7/include/linux/personality.h 2004-06-16 07:19:23.000000000 +0200
27284 +++ linux-2.6.7-abi/include/linux/personality.h 2004-07-22 17:44:21.000000000 +0200
27286 struct exec_domain;
27289 +typedef unsigned long personality_t; /* type for full personality value */
27290 +typedef unsigned char per_id_t; /* type for base per id */
27292 extern int register_exec_domain(struct exec_domain *);
27293 extern int unregister_exec_domain(struct exec_domain *);
27294 -extern int __set_personality(unsigned long);
27295 +extern int __set_personality(personality_t);
27299 @@ -24,49 +27,85 @@
27303 - * Flags for bug emulation.
27304 + * Basic personality ids (per_id).
27306 + * The per_id is occupying byte 0.
27307 + * (It has to fit into an unsigned char! -> per_id_t)
27310 + PERID_LINUX = 0x00, /* native execution mode of os platform */
27311 + PERID_SVR4 = 0x01,
27312 + PERID_SVR3 = 0x02,
27313 + PERID_SCOSVR3 = 0x03, /* and SCO-OS-R5 */
27314 + PERID_WYSEV386 = 0x04,
27315 + PERID_ISCR4 = 0x05,
27316 + PERID_BSD = 0x06, /* and SUN OS */
27317 + PERID_XENIX = 0x07,
27318 + PERID_LINUX32 = 0x08, /* 32 bit mode on non-32 bit platforms */
27319 + PERID_IRIX32 = 0x09, /* IRIX5 32-bit */
27320 + PERID_IRIXN32 = 0x0a, /* IRIX6 new 32-bit */
27321 + PERID_IRIX64 = 0x0b, /* IRIX6 64-bit */
27322 + PERID_RISCOS = 0x0c,
27323 + PERID_SOLARIS = 0x0d,
27324 + PERID_UW7 = 0x0e,
27325 + PERID_OSF4 = 0x0f, /* OSF/1 v4 */
27326 + PERID_HPUX = 0x10,
27327 + PERID_MASK = 0xff,
27331 + * Flags for customizing the behaviour of a base personality id.
27333 - * These occupy the top three bytes.
27334 + * The flags occupy bytes 1 trough 3. Byte 0 is for the base personality id.
27335 + * (Avoid defining the top bit, it will conflict with error returns.)
27338 +#if 1 /* only for compatibilty with old code */
27339 MMAP_PAGE_ZERO = 0x0100000,
27340 ADDR_LIMIT_32BIT = 0x0800000,
27341 SHORT_INODE = 0x1000000,
27342 WHOLE_SECONDS = 0x2000000,
27343 - STICKY_TIMEOUTS = 0x4000000,
27344 + STICKY_TIMEOUTS = 0x4000000,
27345 ADDR_LIMIT_3GB = 0x8000000,
27348 + PERF_MMAP_PAGE_ZERO = 0x00100000,
27349 + PERF_ADDR_LIMIT_32BIT = 0x00800000,
27350 + PERF_SHORT_INODE = 0x01000000,
27351 + PERF_WHOLE_SECONDS = 0x02000000,
27352 + PERF_STICKY_TIMEOUTS = 0x04000000,
27353 + PERF_ADDR_LIMIT_3GB = 0x08000000,
27354 + PERF_MASK = 0xFFFFFF00,
27358 - * Personality types.
27360 - * These go in the low byte. Avoid using the top bit, it will
27361 - * conflict with error returns.
27362 + * Predefined personality profiles.
27365 - PER_LINUX = 0x0000,
27366 - PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT,
27367 - PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
27368 - PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE,
27369 - PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS |
27370 - WHOLE_SECONDS | SHORT_INODE,
27371 - PER_OSR5 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS,
27372 - PER_WYSEV386 = 0x0004 | STICKY_TIMEOUTS | SHORT_INODE,
27373 - PER_ISCR4 = 0x0005 | STICKY_TIMEOUTS,
27374 - PER_BSD = 0x0006,
27375 - PER_SUNOS = 0x0006 | STICKY_TIMEOUTS,
27376 - PER_XENIX = 0x0007 | STICKY_TIMEOUTS | SHORT_INODE,
27377 - PER_LINUX32 = 0x0008,
27378 - PER_LINUX32_3GB = 0x0008 | ADDR_LIMIT_3GB,
27379 - PER_IRIX32 = 0x0009 | STICKY_TIMEOUTS,/* IRIX5 32-bit */
27380 - PER_IRIXN32 = 0x000a | STICKY_TIMEOUTS,/* IRIX6 new 32-bit */
27381 - PER_IRIX64 = 0x000b | STICKY_TIMEOUTS,/* IRIX6 64-bit */
27382 - PER_RISCOS = 0x000c,
27383 - PER_SOLARIS = 0x000d | STICKY_TIMEOUTS,
27384 - PER_UW7 = 0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
27385 - PER_OSF4 = 0x000f, /* OSF/1 v4 */
27386 - PER_HPUX = 0x0010,
27387 - PER_MASK = 0x00ff,
27388 + PER_LINUX = PERID_LINUX,
27389 + PER_LINUX_32BIT = PERID_LINUX | PERF_ADDR_LIMIT_32BIT,
27390 + PER_SVR4 = PERID_SVR4 | PERF_STICKY_TIMEOUTS | PERF_MMAP_PAGE_ZERO,
27391 + PER_SVR3 = PERID_SVR3 | PERF_STICKY_TIMEOUTS | PERF_SHORT_INODE,
27392 + PER_SCOSVR3 = PERID_SCOSVR3 | PERF_STICKY_TIMEOUTS |
27393 + PERF_WHOLE_SECONDS | PERF_SHORT_INODE,
27394 + PER_OSR5 = PERID_SCOSVR3 | PERF_STICKY_TIMEOUTS | PERF_WHOLE_SECONDS,
27395 + PER_WYSEV386 = PERID_WYSEV386 | PERF_STICKY_TIMEOUTS | PERF_SHORT_INODE,
27396 + PER_ISCR4 = PERID_ISCR4 | PERF_STICKY_TIMEOUTS,
27397 + PER_BSD = PERID_BSD,
27398 + PER_SUNOS = PERID_BSD | PERF_STICKY_TIMEOUTS,
27399 + PER_XENIX = PERID_XENIX | PERF_STICKY_TIMEOUTS | PERF_SHORT_INODE,
27400 + PER_LINUX32 = PERID_LINUX32,
27401 + PER_LINUX32_3GB = PERID_LINUX32 | PERF_ADDR_LIMIT_3GB,
27402 + PER_IRIX32 = PERID_IRIX32 | PERF_STICKY_TIMEOUTS,/* IRIX5 32-bit */
27403 + PER_IRIXN32 = PERID_IRIXN32 | PERF_STICKY_TIMEOUTS,/* IRIX6 new 32-bit */
27404 + PER_IRIX64 = PERID_IRIX64 | PERF_STICKY_TIMEOUTS,/* IRIX6 64-bit */
27405 + PER_RISCOS = PERID_RISCOS,
27406 + PER_SOLARIS = PERID_SOLARIS | PERF_STICKY_TIMEOUTS,
27407 + PER_UW7 = PERID_UW7 | PERF_STICKY_TIMEOUTS | PERF_MMAP_PAGE_ZERO,
27408 + PER_OSF4 = PERID_OSF4,/* OSF/1 v4 */
27409 + PER_HPUX = PERID_HPUX,
27410 + PER_MASK = PERID_MASK | PERF_MASK,
27411 + PER_QUERY = 0xffffffff, /* indicates query when passed to sys_personality */
27416 struct exec_domain {
27417 const char *name; /* name of the execdomain */
27418 handler_t handler; /* handler for syscalls */
27419 - unsigned char pers_low; /* lowest personality */
27420 - unsigned char pers_high; /* highest personality */
27421 + per_id_t pers_low; /* lowest personality id for this execdomain */
27422 + per_id_t pers_high; /* highest personality id for this execdomain */
27423 unsigned long *signal_map; /* signal mapping */
27424 unsigned long *signal_invmap; /* reverse signal mapping */
27425 struct map_segment *err_map; /* error mapping */
27426 @@ -94,19 +133,72 @@
27430 - * Return the base personality without flags.
27431 + * Return the base personality id of the given personality.
27433 -#define personality(pers) (pers & PER_MASK)
27434 +#define get_personality_id(personality) ((personality) & PERID_MASK)
27435 +/* compatibility with old naming */
27436 +#define personality(personality) get_personality_id(personality)
27439 + * Return the flags of the given personality.
27441 +#define get_personality_flags(personality) ((personality) & PERF_MASK)
27444 * Personality of the currently running process.
27446 -#define get_personality (current->personality)
27447 +#define get_cur_personality() (current->personality)
27450 + * Return the base personality id of current process.
27452 +#define get_cur_personality_id() get_personality_id(get_cur_personality())
27455 + * Return the flags of the personality of current process.
27457 +#define get_cur_personality_flags() get_personality_flags(get_cur_personality())
27460 + * Check if the personality of the current process matches with the given value.
27462 +#define is_cur_personality(personality) \
27463 + (get_cur_personality() == (personality))
27466 + * Check if the pers id of the current userland process matches the given.
27467 + * No masking does apply to the given id!
27469 +#define is_cur_personality_id(per_id) \
27470 + (get_cur_personality_id() == (per_id))
27473 + * Check if the personality id of the current userland process
27474 + * matches the personality id of the given personality code value.
27476 +#define is_cur_same_personality_id_as(personality) \
27477 + (get_cur_personality_id() == get_personality_id(personality))
27480 + * Check if the current userland process has set one or more of the given flags.
27481 + * This macro works only with single flags!
27483 +#define is_cur_personality_flag(per_flag) \
27484 + (get_cur_personality_flags() & (per_flag))
27487 + * Check if the current userland process has all of the given flags set.
27488 + * This macro works only with single flags!
27490 +#define is_cur_personality_all_flags(per_flags) \
27491 + (get_cur_personality_flags() & (per_flags) == (per_flags))
27494 - * Change personality of the currently running process.
27495 + * Set a new personality for the current userland process (if not already set).
27497 -#define set_personality(pers) \
27498 - ((current->personality == pers) ? 0 : __set_personality(pers))
27499 +#define set_cur_personality(personality) \
27500 + (is_cur_personality(personality) ? 0 : __set_personality(personality))
27501 +/* compatibility with old naming */
27502 +#define set_personality(personality) set_cur_personality(personality)
27504 #endif /* _LINUX_PERSONALITY_H */
27505 diff -Nru linux-2.6.7/include/linux/xout.h linux-2.6.7-abi/include/linux/xout.h
27506 --- linux-2.6.7/include/linux/xout.h 1970-01-01 01:00:00.000000000 +0100
27507 +++ linux-2.6.7-abi/include/linux/xout.h 2004-07-22 17:44:21.000000000 +0200
27510 + * Copyright (c) 1994 Mike Jagdis (jaggy@purplet.demon.co.uk)
27512 +#ifndef _ABI_XOUT_H_
27513 +#define _ABI_XOUT_H_
27518 + * This file is based on available documentation for the Xenix x.out
27519 + * format. Much is missing here. There is just enough to allow us to
27520 + * support 386 small model and not a lot more.
27527 + u_short x_magic; /* magic number */
27528 + u_short x_ext; /* size of header extension */
27531 + * For segmented binaries the following sizes are the sums
27532 + * of the segment sizes.
27534 + long x_text; /* size of text segments */
27535 + long x_data; /* size of initialized data */
27536 + long x_bss; /* size of uninitialized data */
27537 + long x_syms; /* size of symbol table */
27538 + long x_reloc; /* relocation table length */
27540 + long x_entry; /* entry point */
27541 + char x_cpu; /* cpu type and byte/word order */
27542 + char x_relsym; /* undefined */
27543 + u_short x_renv; /* run-time environment */
27547 + * X.out header extension
27551 + * These are unused.
27553 + long xe_trsize; /* ??? */
27554 + long xe_drsize; /* ??? */
27555 + long xe_tbase; /* ??? */
27556 + long xe_dbase; /* ??? */
27558 + long xe_stksize; /* stack size (if XE_FS set) */
27561 + * The following are present if XE_SEG is set.
27563 + long xe_segpos; /* offset to segment table */
27564 + long xe_segsize; /* segment table size */
27565 + long xe_mdtpos; /* offset to machdep table */
27566 + long xe_mdtsize; /* machine dependent table size */
27567 + char xe_mdttype; /* machine dependent table type */
27568 + char xe_pagesize; /* file pagesize, in 512 units */
27569 + char xe_ostype; /* operating system type */
27570 + char xe_osvers; /* operating system version */
27571 + u_short xe_eseg; /* entry segment, machdep */
27572 + u_short xe_sres; /* reserved */
27576 + * X.out segment description.
27579 + u_short xs_type; /* segment type */
27580 + u_short xs_attr; /* segment attributes */
27581 + u_short xs_seg; /* segment number */
27582 + char xs_align; /* log base 2 of alignment */
27583 + char xs_cres; /* unused */
27584 + u_long xs_filpos; /* file position */
27585 + u_long xs_psize; /* physical size (in file) */
27586 + u_long xs_vsize; /* virtual size (in core) */
27587 + u_long xs_rbase; /* relocation base addr/offset */
27588 + u_short xs_noff; /* segment name table offset */
27589 + u_short xs_sres; /* unused */
27590 + long xs_lres; /* unused */
27595 + * Magic number for an x.out header.
27597 +#define X_MAGIC 0x0206 /* indicates x.out header */
27600 + * Codes for x_cpu.
27602 +#define XC_BSWAP 0x80 /* bytes swapped */
27603 +#define XC_WSWAP 0x40 /* words swapped */
27604 +#define XC_8086 0x04 /* I8086 */
27605 +#define XC_286 0x09 /* iAPX 80286 */
27606 +#define XC_286V 0x29 /* iAPX 80286, use xe_osver for version */
27607 +#define XC_386 0x0a /* iAPX 80386 */
27608 +#define XC_186 0x0b /* iAPX 80186 */
27609 +#define XC_CPU 0x3f /* cpu mask */
27612 + * Flags for the run-time environment.
27614 +#define XE_V2 0x4000 /* version 2.x */
27615 +#define XE_V3 0x8000 /* version 3.x */
27616 +#define XE_OSV 0xc000 /* if XE_SEG use xe_osvers ... */
27617 +#define XE_V5 XE_OSV /* else assume v5.x */
27618 +#define XE_VERS 0xc000 /* version mask */
27620 +#define XE_5_3 0x2000 /* binary needs 5.3 functionality */
27621 +#define XE_LOCK 0x1000 /* Use Advisory locking */
27622 +#define XE_SEG 0x0800 /* segment table present */
27623 +#define XE_ABS 0x0400 /* absolute memory image (standalone) */
27624 +#define XE_ITER 0x0200 /* iterated text/data present */
27625 +#define XE_HDATA 0x0100 /* huge model data (never used) */
27626 +#define XE_VMOD XE_HDATA /* virtual module */
27627 +#define XE_FPH 0x0080 /* floating point hardware required */
27628 +#define XE_LTEXT 0x0040 /* large model text */
27629 +#define XE_LDATA 0x0020 /* large model data */
27630 +#define XE_OVER 0x0010 /* text overlay */
27631 +#define XE_FS 0x0008 /* fixed stack */
27632 +#define XE_PURE 0x0004 /* pure text */
27633 +#define XE_SEP 0x0002 /* separate I & D */
27634 +#define XE_EXEC 0x0001 /* executable */
27640 +#define XS_TNULL 0 /* unused segment */
27641 +#define XS_TTEXT 1 /* text segment */
27642 +#define XS_TDATA 2 /* data segment */
27643 +#define XS_TSYMS 3 /* symbol table segment */
27644 +#define XS_TREL 4 /* relocation segment */
27645 +#define XS_TSESTR 5 /* segment table's string table segment */
27646 +#define XS_TGRPS 6 /* group definitions segment */
27648 +#define XS_TIDATA 64 /* iterated data */
27649 +#define XS_TTSS 65 /* tss */
27650 +#define XS_TLFIX 66 /* lodfix */
27651 +#define XS_TDNAME 67 /* descriptor names */
27652 +#define XS_TDTEXT 68 /* debug text segment */
27653 +#define XS_TIDBG XS_TDTEXT
27654 +#define XS_TDFIX 69 /* debug relocation */
27655 +#define XS_TOVTAB 70 /* overlay table */
27657 +#define XS_TSYSTR 72 /* symbol string table */
27660 + * Segment attributes.
27662 +#define XS_AMEM 0x8000 /* is a memory image */
27665 + * For text and data segment types
27667 +#define XS_AITER 0x0001 /* contains iteration records */
27668 +#define XS_AHUGE 0x0002 /* contains huge element */
27669 +#define XS_ABSS 0x0004 /* contains implicit BSS */
27670 +#define XS_APURE 0x0008 /* read only, shareable */
27671 +#define XS_AEDOWN 0x0010 /* expands downward (stack) */
27672 +#define XS_APRIV 0x0020 /* may not be combined */
27673 +#define XS_A32BIT 0x0040 /* is 32 bit */
27676 + * File position macros, valid only if !XE_SEG.
27678 +#define XEXTPOS(xp) ((long) sizeof(struct xexec))
27679 +#define XTEXTPOS(xp) (XEXTPOS(xp) + (long) (xp)->x_ext)
27680 +#define XDATAPOS(xp) (XTEXTPOS(xp) + (xp)->x_text)
27681 +#define XBSSPOS(xp) (XDATAPOS(xp) + (xp)->x_data)
27682 +#define XSYMPOS(xp) (XDATAPOS(xp) + (xp)->x_data)
27683 +#define XRELPOS(xp) (XSYMPOS(xp) + (xp)->x_syms)
27684 +#define XENDPOS(xp) (XRELPOS(xp) + (xp)->x_reloc)
27686 +#define XRTEXTPOS(xp, ep) (XRELPOS(xp))
27687 +#define XRDATAPOS(xp, ep) (XRELPOS(xp) + (ep)->xe_trsize)
27691 + * Specials for the Linux Xenix 286 emulator.
27693 + * The base address that 286 segments are loaded above. This should be
27694 + * above memory used by the emulator overlay. Actual segment data
27695 + * starts slightly higher than this since we map the xexec and xext
27696 + * structures of the executable to this address.
27698 +#define X286_MAP_ADDR 0x4000000
27700 +#endif /* _ABI_XOUT_H_ */
27701 diff -Nru linux-2.6.7/include/net/sock.h linux-2.6.7-abi/include/net/sock.h
27702 --- linux-2.6.7/include/net/sock.h 2004-06-16 07:19:43.000000000 +0200
27703 +++ linux-2.6.7-abi/include/net/sock.h 2004-07-22 17:44:21.000000000 +0200
27704 @@ -381,6 +381,7 @@
27711 static inline void sock_set_flag(struct sock *sk, enum sock_flags flag)
27712 diff -Nru linux-2.6.7/kernel/exec_domain.c linux-2.6.7-abi/kernel/exec_domain.c
27713 --- linux-2.6.7/kernel/exec_domain.c 2004-06-16 07:19:36.000000000 +0200
27714 +++ linux-2.6.7-abi/kernel/exec_domain.c 2004-07-22 17:44:21.000000000 +0200
27715 @@ -18,10 +18,14 @@
27716 #include <linux/types.h>
27719 -static void default_handler(int, struct pt_regs *);
27720 +#if !defined(CONFIG_ABI_LATE_PROBING)
27721 +static void lcall_default_handler(int, struct pt_regs *);
27723 +static void lcall_autodetect_handler(int, struct pt_regs *);
27726 -static struct exec_domain *exec_domains = &default_exec_domain;
27727 -static rwlock_t exec_domains_lock = RW_LOCK_UNLOCKED;
27728 +static struct exec_domain *exec_domains = &default_exec_domain; /* linked list of registered exed domains */
27729 +static rwlock_t exec_domains_lock = RW_LOCK_UNLOCKED; /* access lock for linked list */
27732 static u_long ident_map[32] = {
27733 @@ -31,77 +35,125 @@
27734 24, 25, 26, 27, 28, 29, 30, 31
27737 +#define PERID_DEFAULT PERID_LINUX /* Linux personality id. */
27739 struct exec_domain default_exec_domain = {
27740 .name = "Linux", /* name */
27741 - .handler = default_handler, /* lcall7 causes a seg fault. */
27742 - .pers_low = 0, /* PER_LINUX personality. */
27743 - .pers_high = 0, /* PER_LINUX personality. */
27744 +#if !defined(CONFIG_ABI_LATE_PROBING)
27745 + .handler = lcall_default_handler,/* any unknown lcall raises a segmentation fault */
27747 + .handler = lcall_autodetect_handler,/* lcall 0x07 & 0x27 causes autoconfig or a seg fault. */
27749 + .pers_low = PERID_DEFAULT, /* low personality id */
27750 + .pers_high = PERID_DEFAULT, /* high personality id */
27751 .signal_map = ident_map, /* Identity map signals. */
27752 .signal_invmap = ident_map, /* - both ways. */
27756 +#if !defined(CONFIG_ABI_LATE_PROBING)
27758 -default_handler(int segment, struct pt_regs *regp)
27759 +lcall_default_handler(int segment, struct pt_regs *regp)
27762 + /* raise a segfault for the current process */
27763 + send_sig(SIGSEGV, current, 1);
27767 +lcall_autodetect_handler(int segment, struct pt_regs *regp)
27769 + personality_t personality = PER_LINUX;
27772 * This may have been a static linked SVr4 binary, so we would
27773 * have the personality set incorrectly. Or it might have been
27774 * a Solaris/x86 binary. We can tell which because the former
27775 * uses lcall7, while the latter used lcall 0x27.
27776 - * Try to find or load the appropriate personality, and fall back
27777 - * to just forcing a SEGV.
27778 + * Try to find or load the appropriate personality on first invocation.
27779 + * If loading failed and handler is still default then raise a SEGV.
27781 * XXX: this is IA32-specific and should be moved to the MD-tree.
27786 - pers = abi_defhandler_lcall7;
27787 + personality = abi_defhandler_lcall7;
27790 - pers = PER_SOLARIS;
27791 + personality = PER_SOLARIS;
27795 - set_personality(pers);
27796 + set_personality(personality);
27798 - if (current_thread_info()->exec_domain->handler != default_handler)
27799 - current_thread_info()->exec_domain->handler(segment, regp);
27801 + if (current_thread_info()->exec_domain->handler == lcall_autodetect_handler)
27803 + /* we are still at the same handler - recursing impossible! */
27804 + /* raise a segfault for the current process */
27805 send_sig(SIGSEGV, current, 1);
27809 + /* identifying the needed handler at exec time succeeded. */
27810 + /* recursively call these installed handler (one level deep) */
27811 + current_thread_info()->exec_domain->handler(segment, regp);
27816 static struct exec_domain *
27817 lookup_exec_domain(u_long personality)
27819 struct exec_domain * ep;
27820 - u_long pers = personality(personality);
27822 + per_id_t per_id = get_personality_id(personality);
27824 + /* browse for id in list of exec domains */
27825 read_lock(&exec_domains_lock);
27826 for (ep = exec_domains; ep; ep = ep->next) {
27827 - if (pers >= ep->pers_low && pers <= ep->pers_high)
27828 + if (per_id >= ep->pers_low && per_id <= ep->pers_high)
27829 if (try_module_get(ep->module))
27831 + read_unlock(&exec_domains_lock);
27835 + read_unlock(&exec_domains_lock);
27838 - read_unlock(&exec_domains_lock);
27839 - request_module("personality-%ld", pers);
27840 - read_lock(&exec_domains_lock);
27841 + /* request loading of all data bound to personality id */
27842 + request_module("personality-%i", per_id);
27844 + /* browse for id in list of exec domains - once again */
27845 + read_lock(&exec_domains_lock);
27846 for (ep = exec_domains; ep; ep = ep->next) {
27847 - if (pers >= ep->pers_low && pers <= ep->pers_high)
27848 + if (per_id >= ep->pers_low && per_id <= ep->pers_high)
27849 if (try_module_get(ep->module))
27851 + read_unlock(&exec_domains_lock);
27855 + read_unlock(&exec_domains_lock);
27858 + /* matching exec domain is still not availabel. */
27859 +#if !defined(CONFIG_ABI_LATE_PROBING)
27860 + ep = NULL; /* error */
27863 + printk(KERN_WARNING \
27864 + "%s: personality-%i not found, using %i instead.\n",
27865 + __FILE__, per_id, PER_DEFAULT);
27868 + /* we will start with default exec domain. */
27869 + /* this will allow simple programs (mov/ret) to fully execute. */
27870 + /* complex programs will run until the very first syscall. */
27871 + /* then the syscall handler will attempt switch the identity again. */
27872 ep = &default_exec_domain;
27876 - read_unlock(&exec_domains_lock);
27880 @@ -159,25 +211,36 @@
27881 struct exec_domain *ep, *oep;
27883 ep = lookup_exec_domain(personality);
27887 + /* if the needed exec domain is already set for this process
27888 + then we save the works for registering with the new fs
27889 + and releasing the old fs and exec_domain,
27890 + we just have to update the personality to this process */
27891 if (ep == current_thread_info()->exec_domain) {
27892 current->personality = personality;
27896 + /* when the new fs is already bound to the current process */
27897 if (atomic_read(¤t->fs->count) != 1) {
27898 struct fs_struct *fsp, *ofsp;
27900 + /* register as client for the new fs by copying it */
27901 fsp = copy_fs_struct(current->fs);
27903 module_put(ep->module);
27907 + /* replace the old with the new fs */
27908 task_lock(current);
27909 ofsp = current->fs;
27911 task_unlock(current);
27913 + /* quit as a client to the old fs */
27914 put_fs_struct(ofsp);
27917 @@ -186,17 +249,20 @@
27921 + /* replace the old with the new exec_domain */
27922 current->personality = personality;
27923 oep = current_thread_info()->exec_domain;
27924 current_thread_info()->exec_domain = ep;
27927 + /* quit as client for the old exec_domain */
27928 module_put(oep->module);
27934 -get_exec_domain_list(char *page)
27935 +get_exec_domain_list(char *page) /* handler for /proc/execdomains */
27937 struct exec_domain *ep;
27939 @@ -215,11 +281,12 @@
27941 u_long old = current->personality;
27943 - if (personality != 0xffffffff) {
27944 - set_personality(personality);
27945 - if (current->personality != personality)
27948 + if (personality == PER_QUERY)
27949 + return (long)old;
27951 + set_personality(personality);
27952 + if (get_cur_personality() != personality)
27957 diff -Nru linux-2.6.7/kernel/fork.c linux-2.6.7-abi/kernel/fork.c
27958 --- linux-2.6.7/kernel/fork.c 2004-06-16 07:18:57.000000000 +0200
27959 +++ linux-2.6.7-abi/kernel/fork.c 2004-07-22 17:44:21.000000000 +0200
27960 @@ -1289,3 +1289,9 @@
27961 sizeof(struct mm_struct), 0,
27962 SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
27965 +/* symbol exports for LinuxABI Sytem V R4 support */
27966 +/* for ease of use we are exporting those needed symbols permanently */
27967 +/* #if CONFIG_ABI_SVR4 == m */
27968 +EXPORT_SYMBOL(do_fork);
27970 diff -Nru linux-2.6.7/kernel/Makefile linux-2.6.7-abi/kernel/Makefile
27971 --- linux-2.6.7/kernel/Makefile 2004-06-16 07:19:01.000000000 +0200
27972 +++ linux-2.6.7-abi/kernel/Makefile 2004-07-22 17:44:21.000000000 +0200
27974 sysctl.o capability.o ptrace.o timer.o user.o \
27975 signal.o sys.o kmod.o workqueue.o pid.o \
27976 rcupdate.o intermodule.o extable.o params.o posix-timers.o \
27978 + kthread.o syscall_ksyms.o
27980 obj-$(CONFIG_FUTEX) += futex.o
27981 obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
27982 diff -Nru linux-2.6.7/kernel/syscall_ksyms.c linux-2.6.7-abi/kernel/syscall_ksyms.c
27983 --- linux-2.6.7/kernel/syscall_ksyms.c 1970-01-01 01:00:00.000000000 +0100
27984 +++ linux-2.6.7-abi/kernel/syscall_ksyms.c 2004-07-22 17:44:21.000000000 +0200
27987 + * Exports all Linux syscalls.
27988 + * Christoph Hellwig (hch@caldera.de), 2001
27991 +#include <linux/config.h>
27992 +#include <linux/module.h>
27993 +#include <linux/personality.h>
27994 +#define __KERNEL_SYSCALLS__
27995 +#include <linux/unistd.h>
27996 +#include <linux/syscalls.h>
27997 +#include <linux/msg.h>
27998 +#include <linux/sem.h>
27999 +#include <linux/shm.h>
28000 +#include <linux/fs.h>
28002 +EXPORT_SYMBOL(sys_uselib);
28003 +EXPORT_SYMBOL(sys_sync);
28004 +EXPORT_SYMBOL(sys_fsync);
28005 +EXPORT_SYMBOL(sys_fdatasync);
28006 +EXPORT_SYMBOL(sys_dup);
28007 +EXPORT_SYMBOL(sys_dup2);
28008 +EXPORT_SYMBOL(sys_fcntl);
28009 +#if (BITS_PER_LONG == 32)
28010 +EXPORT_SYMBOL(sys_fcntl64);
28012 +EXPORT_SYMBOL(sys_ioctl);
28013 +EXPORT_SYMBOL(sys_link);
28014 +EXPORT_SYMBOL(sys_mkdir);
28015 +EXPORT_SYMBOL(sys_mknod);
28016 +EXPORT_SYMBOL(sys_rename);
28017 +EXPORT_SYMBOL(sys_rmdir);
28018 +EXPORT_SYMBOL(sys_symlink);
28019 +EXPORT_SYMBOL(sys_unlink);
28020 +EXPORT_SYMBOL(sys_umount);
28021 +EXPORT_SYMBOL(sys_oldumount);
28022 +EXPORT_SYMBOL(sys_mount);
28023 +EXPORT_SYMBOL(sys_pivot_root);
28024 +EXPORT_SYMBOL(sys_access);
28025 +EXPORT_SYMBOL(sys_chdir);
28026 +EXPORT_SYMBOL(sys_fchdir);
28027 +EXPORT_SYMBOL(sys_chroot);
28028 +EXPORT_SYMBOL(sys_chmod);
28029 +EXPORT_SYMBOL(sys_fchmod);
28030 +EXPORT_SYMBOL(sys_chown);
28031 +EXPORT_SYMBOL(sys_lchown);
28032 +EXPORT_SYMBOL(sys_fchown);
28033 +EXPORT_SYMBOL(sys_close);
28034 +#if !defined(__alpha__)
28035 +EXPORT_SYMBOL(sys_creat);
28037 +EXPORT_SYMBOL(sys_open);
28038 +EXPORT_SYMBOL(sys_statfs);
28039 +EXPORT_SYMBOL(sys_fstatfs);
28040 +EXPORT_SYMBOL(sys_ftruncate);
28041 +EXPORT_SYMBOL(sys_ftruncate64);
28042 +EXPORT_SYMBOL(sys_truncate);
28043 +EXPORT_SYMBOL(sys_truncate64);
28044 +#if !defined(__alpha__) && !defined(__ia64__)
28045 +EXPORT_SYMBOL(sys_utime);
28047 +EXPORT_SYMBOL(sys_utimes);
28048 +EXPORT_SYMBOL(sys_vhangup);
28049 +#if !defined(__alpha__)
28050 +EXPORT_SYMBOL(sys_lseek);
28052 +EXPORT_SYMBOL(sys_llseek);
28053 +EXPORT_SYMBOL(sys_read);
28054 +EXPORT_SYMBOL(sys_readv);
28055 +EXPORT_SYMBOL(sys_pread64);
28056 +EXPORT_SYMBOL(sys_pwrite64);
28057 +EXPORT_SYMBOL(sys_write);
28058 +EXPORT_SYMBOL(sys_writev);
28059 +EXPORT_SYMBOL(old_readdir);
28060 +EXPORT_SYMBOL(sys_poll);
28061 +EXPORT_SYMBOL(sys_select);
28062 +EXPORT_SYMBOL(sys_readlink);
28063 +EXPORT_SYMBOL(sys_sysfs);
28064 +EXPORT_SYMBOL(sys_acct);
28065 +EXPORT_SYMBOL(sys_exit);
28066 +EXPORT_SYMBOL(sys_getitimer);
28067 +EXPORT_SYMBOL(sys_setitimer);
28068 +EXPORT_SYMBOL(sys_gettimeofday);
28069 +EXPORT_SYMBOL(sys_settimeofday);
28070 +EXPORT_SYMBOL(sys_stime);
28071 +EXPORT_SYMBOL(sys_time);
28072 +#if !defined(__alpha__)
28073 +EXPORT_SYMBOL(sys_nice);
28075 +EXPORT_SYMBOL(sys_sched_setscheduler);
28076 +EXPORT_SYMBOL(sys_sched_setparam);
28077 +EXPORT_SYMBOL(sys_sched_getscheduler);
28078 +EXPORT_SYMBOL(sys_sched_getparam);
28079 +EXPORT_SYMBOL(sys_sched_get_priority_max);
28080 +EXPORT_SYMBOL(sys_sched_get_priority_min);
28081 +EXPORT_SYMBOL(sys_sched_rr_get_interval);
28082 +EXPORT_SYMBOL(sys_kill);
28083 +EXPORT_SYMBOL(sys_rt_sigaction);
28084 +EXPORT_SYMBOL(sys_rt_sigpending);
28085 +EXPORT_SYMBOL(sys_rt_sigprocmask);
28086 +EXPORT_SYMBOL(sys_rt_sigtimedwait);
28087 +EXPORT_SYMBOL(sys_sigaltstack);
28088 +EXPORT_SYMBOL(sys_sigpending);
28089 +EXPORT_SYMBOL(sys_sigprocmask);
28090 +EXPORT_SYMBOL(sys_sigsuspend);
28091 +EXPORT_SYMBOL(sys_gethostname);
28092 +EXPORT_SYMBOL(sys_sethostname);
28093 +EXPORT_SYMBOL(sys_setdomainname);
28094 +EXPORT_SYMBOL(sys_getrlimit);
28095 +EXPORT_SYMBOL(sys_setsid);
28096 +EXPORT_SYMBOL(sys_getsid);
28097 +EXPORT_SYMBOL(sys_getpgid);
28098 +EXPORT_SYMBOL(sys_setpgid);
28099 +EXPORT_SYMBOL(sys_getgroups);
28100 +EXPORT_SYMBOL(sys_setgroups);
28101 +EXPORT_SYMBOL(sys_setpriority);
28102 +EXPORT_SYMBOL(sys_getpriority);
28103 +EXPORT_SYMBOL(sys_reboot);
28104 +EXPORT_SYMBOL(sys_setgid);
28105 +EXPORT_SYMBOL(sys_setuid);
28106 +EXPORT_SYMBOL(sys_times);
28107 +EXPORT_SYMBOL(sys_umask);
28108 +EXPORT_SYMBOL(sys_prctl);
28109 +EXPORT_SYMBOL(sys_setreuid);
28110 +EXPORT_SYMBOL(sys_setregid);
28111 +#if !defined(__alpha__) && !defined(__ia64__)
28112 +EXPORT_SYMBOL(sys_alarm);
28114 +#if !defined(__alpha__)
28115 +EXPORT_SYMBOL(sys_getpid);
28116 +EXPORT_SYMBOL(sys_getppid);
28117 +EXPORT_SYMBOL(sys_getuid);
28118 +EXPORT_SYMBOL(sys_geteuid);
28119 +EXPORT_SYMBOL(sys_getgid);
28120 +EXPORT_SYMBOL(sys_getegid);
28122 +EXPORT_SYMBOL(sys_gettid);
28123 +EXPORT_SYMBOL(sys_nanosleep);
28124 +#if defined(CONFIG_UID16)
28125 +EXPORT_SYMBOL(sys_setreuid16);
28126 +EXPORT_SYMBOL(sys_setregid16);
28127 +EXPORT_SYMBOL(sys_getgroups16);
28128 +EXPORT_SYMBOL(sys_setgroups16);
28130 +EXPORT_SYMBOL(sys_wait4);
28131 +EXPORT_SYMBOL(sys_waitpid);
28132 +EXPORT_SYMBOL(sys_sendfile);
28133 +EXPORT_SYMBOL(sys_brk);
28134 +EXPORT_SYMBOL(sys_msync);
28135 +EXPORT_SYMBOL(sys_madvise);
28136 +EXPORT_SYMBOL(sys_mincore);
28137 +EXPORT_SYMBOL(sys_munmap);
28138 +EXPORT_SYMBOL(sys_mprotect);
28139 +EXPORT_SYMBOL(sys_socket);
28140 +EXPORT_SYMBOL(sys_socketpair);
28141 +EXPORT_SYMBOL(sys_bind);
28142 +EXPORT_SYMBOL(sys_listen);
28143 +EXPORT_SYMBOL(sys_accept);
28144 +EXPORT_SYMBOL(sys_connect);
28145 +EXPORT_SYMBOL(sys_getsockname);
28146 +EXPORT_SYMBOL(sys_getpeername);
28147 +EXPORT_SYMBOL(sys_sendto);
28148 +EXPORT_SYMBOL(sys_send);
28149 +EXPORT_SYMBOL(sys_recvfrom);
28150 +EXPORT_SYMBOL(sys_setsockopt);
28151 +EXPORT_SYMBOL(sys_getsockopt);
28152 +EXPORT_SYMBOL(sys_shutdown);
28153 +EXPORT_SYMBOL(sys_sendmsg);
28154 +EXPORT_SYMBOL(sys_recvmsg);
28155 +EXPORT_SYMBOL(sys_socketcall);
28157 +EXPORT_SYMBOL(sys_msgget);
28158 +EXPORT_SYMBOL(sys_msgsnd);
28159 +EXPORT_SYMBOL(sys_msgrcv);
28160 +EXPORT_SYMBOL(sys_msgctl);
28161 +EXPORT_SYMBOL(sys_semget);
28162 +EXPORT_SYMBOL(sys_semop);
28163 +EXPORT_SYMBOL(sys_semctl);
28164 +EXPORT_SYMBOL(sys_shmget);
28165 +EXPORT_SYMBOL(do_shmat);
28166 +EXPORT_SYMBOL(sys_shmdt);
28167 +EXPORT_SYMBOL(sys_shmctl);
28168 diff -Nru linux-2.6.7/Makefile linux-2.6.7-abi/Makefile
28169 --- linux-2.6.7/Makefile 2004-06-16 07:19:37.000000000 +0200
28170 +++ linux-2.6.7-abi/Makefile 2004-07-22 17:44:51.000000000 +0200
28171 @@ -422,6 +422,7 @@
28176 endif # KBUILD_EXTMOD
28178 ifeq ($(dot-config),1)
28179 @@ -488,12 +489,14 @@
28181 vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
28182 $(core-y) $(core-m) $(drivers-y) $(drivers-m) \
28183 - $(net-y) $(net-m) $(libs-y) $(libs-m)))
28184 + $(net-y) $(net-m) $(libs-y) $(libs-m) \
28185 + $(abi-y) $(abi-m)))
28187 vmlinux-alldirs := $(sort $(vmlinux-dirs) $(patsubst %/,%,$(filter %/, \
28188 $(init-n) $(init-) \
28189 $(core-n) $(core-) $(drivers-n) $(drivers-) \
28190 - $(net-n) $(net-) $(libs-n) $(libs-))))
28191 + $(net-n) $(net-) $(libs-n) $(libs-) \
28192 + $(abi-n) $(abi-))))
28194 init-y := $(patsubst %/, %/built-in.o, $(init-y))
28195 core-y := $(patsubst %/, %/built-in.o, $(core-y))
28196 @@ -502,6 +505,7 @@
28197 libs-y1 := $(patsubst %/, %/lib.a, $(libs-y))
28198 libs-y2 := $(patsubst %/, %/built-in.o, $(libs-y))
28199 libs-y := $(libs-y1) $(libs-y2)
28200 +abi-y := $(patsubst %/, %/built-in.o, $(abi-y))
28203 # ---------------------------------------------------------------------------
28204 @@ -513,7 +517,7 @@
28205 # we cannot yet know if we will need to relink vmlinux.
28206 # So we descend into init/ inside the rule for vmlinux again.
28208 -vmlinux-objs := $(head-y) $(init-y) $(core-y) $(libs-y) $(drivers-y) $(net-y)
28209 +vmlinux-objs := $(head-y) $(init-y) $(core-y) $(libs-y) $(drivers-y) $(net-y) $(abi-y)
28211 quiet_cmd_vmlinux__ = LD $@
28212 define cmd_vmlinux__
28213 @@ -523,6 +527,7 @@
28219 $(filter .tmp_kallsyms%,$^) \
28221 diff -Nru linux-2.6.7/net/socket.c linux-2.6.7-abi/net/socket.c
28222 --- linux-2.6.7/net/socket.c 2004-06-16 07:19:13.000000000 +0200
28223 +++ linux-2.6.7-abi/net/socket.c 2004-07-22 17:44:21.000000000 +0200
28224 @@ -120,7 +120,7 @@
28225 * in the operation structures but are done directly via the socketcall() multiplexor.
28228 -static struct file_operations socket_file_ops = {
28229 +struct file_operations socket_file_ops = {
28230 .owner = THIS_MODULE,
28231 .llseek = no_llseek,
28232 .aio_read = sock_aio_read,
28233 @@ -2024,7 +2024,7 @@
28235 #endif /* CONFIG_PROC_FS */
28237 -/* ABI emulation layers need these two */
28238 +/* LinuxABI emulation layer modules do need these exports */
28239 EXPORT_SYMBOL(move_addr_to_kernel);
28240 EXPORT_SYMBOL(move_addr_to_user);
28241 EXPORT_SYMBOL(sock_alloc);
28242 @@ -2040,3 +2040,8 @@
28243 EXPORT_SYMBOL(sock_unregister);
28244 EXPORT_SYMBOL(sock_wake_async);
28245 EXPORT_SYMBOL(sockfd_lookup);
28246 +/* symbol exports for LinuxABI Sytem V R4 support */
28247 +/* for ease of use we are exporting those needed symbols permanently */
28248 +/* #if CONFIG_ABI_SVR4 == m */
28249 +EXPORT_SYMBOL(socket_file_ops);