Return to BSD News archive
Received: by minnie.vk1xwt.ampr.org with NNTP id AA274 ; Sun, 31 Jan 93 14:00:42 EST Newsgroups: comp.unix.bsd Path: sserve!manuel.anu.edu.au!munnari.oz.au!sgiblab!swrinde!cs.utexas.edu!uunet!email!mbirgmei From: mbirgmei@email.tuwien.ac.at (Martin BIRGMEIER) Subject: Re: SYS_getdomainname error (using getdomainname patch) Message-ID: <1993Jan29.075949.19503@email.tuwien.ac.at> Summary: incomplete domainname patch Keywords: domainname Organization: Technical University of Vienna References: <1ka4e3INNi4p@hrd769.brooks.af.mil> Date: Fri, 29 Jan 1993 07:59:49 GMT Lines: 196 In article <1ka4e3INNi4p@hrd769.brooks.af.mil> burgess@hrd769.brooks.af.mil (Dave Burgess) writes: > I have recently been trying to get the yellow pages (yp) programs to work >with 386bsd. This involved implementing a getdomainname function in the >kernel and in libc.a . > [...] > > When does a SYS_* label get generated? I can't find it in any of the >sources. Pointers would be REALLY appreciated at this point. The domainname patch was posted in this article... From: deraadt@newt.cuc.ab.ca (Theo de Raadt) Subject: 386BSD: PATCH to add domainname(1) Message-ID: <DERAADT.92Nov19025510@newt.newt.cuc.ab.ca> Sender: news@newt.cuc.ab.ca Organization: little lizard city Date: Thu, 19 Nov 1992 09:55:10 GMT .... and was incomplete. Here's how I changed it: ============================== cut here ============================== *** /usr/src/sys.386bsd/kern/syscalls.c.DOMAIN_ORIG Tue Dec 24 23:24:08 1991 --- /usr/src/sys.386bsd/kern/syscalls.c Tue Jan 5 13:46:20 1993 *************** *** 193,200 **** "#160", /* 160 = nosys */ "#161", /* 161 = nosys */ #endif ! "#162", /* 162 = nosys */ ! "#163", /* 163 = nosys */ "#164", /* 164 = nosys */ "#165", /* 165 = nosys */ "#166", /* 166 = nosys */ --- 193,200 ---- "#160", /* 160 = nosys */ "#161", /* 161 = nosys */ #endif ! "getdomainname", /* 162 = getdomainname */ ! "setdomainname", /* 163 = setdomainname */ "#164", /* 164 = nosys */ "#165", /* 165 = nosys */ "#166", /* 166 = nosys */ *** /usr/src/sys.386bsd/kern/kern_xxx.c.DOMAIN_ORIG Tue Dec 24 23:24:08 1991 --- /usr/src/sys.386bsd/kern/kern_xxx.c Tue Jan 5 13:46:20 1993 *************** *** 103,108 **** --- 103,143 ---- } /* ARGSUSED */ + getdomainname(p, uap, retval) + struct proc *p; + struct args { + char *domainname; + u_int len; + } *uap; + int *retval; + { + if (uap->len > domainnamelen + 1) + uap->len = domainnamelen + 1; + return (copyout((caddr_t)domainname, (caddr_t)uap->domainname, uap->len)); + } + + /* ARGSUSED */ + setdomainname(p, uap, retval) + struct proc *p; + struct args { + char *domainname; + u_int len; + } *uap; + int *retval; + { + int error; + + if (error = suser(p->p_ucred, &p->p_acflag)) + return (error); + if (uap->len > sizeof (domainname) - 1) + return EINVAL; + domainnamelen = uap->len; + error = copyin((caddr_t)uap->domainname, domainname, uap->len); + domainname[domainnamelen] = 0; + return (error); + } + + /* ARGSUSED */ reboot(p, uap, retval) struct proc *p; struct args { *** /usr/src/sys.386bsd/kern/init_sysent.c.DOMAIN_ORIG Tue Dec 24 23:24:07 1991 --- /usr/src/sys.386bsd/kern/init_sysent.c Tue Jan 5 13:46:20 1993 *************** *** 158,163 **** --- 158,165 ---- int getfh(); #else #endif + int getdomainname(); + int setdomainname(); #ifdef SYSVSHM int shmsys(); #else *************** *** 400,407 **** 0, nosys, /* 160 = nosys */ 0, nosys, /* 161 = nosys */ #endif ! 0, nosys, /* 162 = nosys */ ! 0, nosys, /* 163 = nosys */ 0, nosys, /* 164 = nosys */ 0, nosys, /* 165 = nosys */ 0, nosys, /* 166 = nosys */ --- 402,409 ---- 0, nosys, /* 160 = nosys */ 0, nosys, /* 161 = nosys */ #endif ! 2, getdomainname, /* 162 = getdomainname */ ! 2, setdomainname, /* 163 = setdomainname */ 0, nosys, /* 164 = nosys */ 0, nosys, /* 165 = nosys */ 0, nosys, /* 166 = nosys */ *** /usr/src/sys.386bsd/sys/syscall.h.DOMAIN_ORIG Tue Dec 24 23:24:18 1991 --- /usr/src/sys.386bsd/sys/syscall.h Tue Jan 5 15:14:44 1993 *************** *** 160,165 **** --- 160,167 ---- #define SYS_fstatfs 158 #define SYS_async_daemon 160 #define SYS_getfh 161 + #define SYS_getdomainname 162 + #define SYS_setdomainname 163 #define SYS_shmsys 171 #define SYS_setgid 181 #define SYS_setegid 182 *** /usr/src/sys.386bsd/sys/kernel.h.DOMAIN_ORIG Tue Dec 24 23:24:17 1991 --- /usr/src/sys.386bsd/sys/kernel.h Tue Jan 5 14:00:11 1993 *************** *** 40,45 **** --- 40,47 ---- long hostid; char hostname[MAXHOSTNAMELEN]; int hostnamelen; + char domainname[MAXHOSTNAMELEN]; + int domainnamelen; /* 1.2 */ struct timeval boottime; *** /usr/src/lib/libc/sys/Makefile.inc.DOMAIN_ORIG Thu Feb 13 08:42:58 1992 --- /usr/src/lib/libc/sys/Makefile.inc Tue Jan 5 13:44:12 1993 *************** *** 27,33 **** setrlimit.o setsid.o setsockopt.o settimeofday.o setuid.o \ shutdown.o sigaction.o sigstack.o socket.o socketpair.o stat.o \ statfs.o swapon.o symlink.o sync.o truncate.o umask.o unlink.o \ ! unmount.o utimes.o vadvise.o wait4.o write.o writev.o PSEUDO= _exit.o _getlogin.o --- 27,34 ---- setrlimit.o setsid.o setsockopt.o settimeofday.o setuid.o \ shutdown.o sigaction.o sigstack.o socket.o socketpair.o stat.o \ statfs.o swapon.o symlink.o sync.o truncate.o umask.o unlink.o \ ! unmount.o utimes.o vadvise.o wait4.o write.o writev.o getdomainname.o \ ! setdomainname.o PSEUDO= _exit.o _getlogin.o *************** *** 80,86 **** shutdown.0 sigaction.0 sigprocmask.0 sigreturn.0 sigstack.0 \ sigsuspend.0 socket.0 socketpair.0 stat.0 statfs.0 swapon.0 \ symlink.0 sync.0 syscall.0 truncate.0 umask.0 unlink.0 utimes.0 \ ! vfork.0 wait.0 write.0 MLINKS+=brk.2 sbrk.2 MLINKS+=dup.2 dup2.2 --- 81,87 ---- shutdown.0 sigaction.0 sigprocmask.0 sigreturn.0 sigstack.0 \ sigsuspend.0 socket.0 socketpair.0 stat.0 statfs.0 swapon.0 \ symlink.0 sync.0 syscall.0 truncate.0 umask.0 unlink.0 utimes.0 \ ! vfork.0 wait.0 write.0 getdomainname.0 MLINKS+=brk.2 sbrk.2 MLINKS+=dup.2 dup2.2 *************** *** 110,112 **** --- 111,114 ---- MLINKS+=truncate.2 ftruncate.2 MLINKS+=wait.2 wait3.2 wait.2 wait4.2 wait.2 waitpid.2 MLINKS+=write.2 writev.2 + MLINKS+=getdomainname.2 setdomainname.2 ============================== cut here ============================== Hope this helps, Martin