Xref: utzoo comp.protocols.nfs:1779 comp.sys.dec:5039 comp.unix.ultrix:6186 Path: utzoo!utgpu!watserv1!watmath!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!samsung!uunet!mcsun!cernvax!chx400!chx400!vichy.glance.ch!olivert From: olivert@glance.ch (Oliver Tschichold) Newsgroups: comp.protocols.nfs,comp.sys.dec,comp.unix.ultrix Subject: nfs-mount c-call problem on Ultrix 4.1 Keywords: Ultrix, NFS, mount Message-ID: <1991Feb13.124718.11746@glance.ch> Date: 13 Feb 91 12:47:18 GMT Sender: olivert@glance.ch Reply-To: olivert@glance.ch Organization: Glance Ltd., CH-8162 Steinmaur Lines: 69 We are using a uVAX II and a DECsystem 5100 both running Ultrix 4.1. I would like to mount and umount NFS-directories in a C program. This is what I have done: ----------cut here------------ #include #include #include #include int i; char foreign[]="otherhost:/", local[]="/mnt", para[]=""; main() { i=mount(foreign,local,0,GT_NFS,para); fprintf(stderr,"mount returned %i, error=%i \n",i,errno); perror("mount_test"); }; --------end cut here---------- I compile with cc -o mount_test mount_test.c (VAX C) What's happening? When I start the program as root, I get the following output: ----------cut here------------ mount returned -1, error=14 mount_test: Bad address --------end cut here---------- This happens on both the uVAX II and the DECsystem 5100 trying to mount the other's root directory. Both servers export their root directories in /etc/exports. Here are some results of my own research: - The manual mount(2nfs) lists GT_NFS as 0x04. The actual value as defined in is 0x05, however. Changing this value does not make it work, although the error code changes. - Adding parameters to the parameter string does not have any impact. What do I do wrong? Please respond via email. If the responses are numerous, I'll post a summary. Thanx -- Oliver _______ _____/ _____ \ Glance Ltd. Software Engineering ______/ / \ \__ \_\_/_/ Glance Ltd. / /|| Gewerbestrasse 4 __/ / || CH-8162 Steinmaur Telephone: 41-1-853-3949 |___/ || Switzerland Telefax: 41-1-853-0809 Oliver Tschichold dipl. Informatik-Ing. ETH (M. Computer Sci.) System-Administrator -- Oliver Tschichold Glance Ltd. olivert@glance.ch Gewerbestrasse 4 UUCP: {...}!{uunet,mcsun}!vichy!olivert 8162 Steinmaur X.400: S=olivert;O=glance;P=switch;A=arCom;C=ch Switzerland