* [parisc-linux] utssys?
@ 1999-08-07 13:31 Matthew Wilcox
1999-08-07 15:45 ` John David Anglin
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Matthew Wilcox @ 1999-08-07 13:31 UTC (permalink / raw)
To: parisc-linux
Can anyone tell me what the utssys() system call does? There's no manual
page for it. From tusc, I can see:
utssys("HP-UX", 0, 0) ............................................ = 0
so all I need do to get it to work on Linux is return 0, but I'd like
to understand a little more.
I also can't find a manual page for sigsetreturn() which I probably need
to understand more deeply than utssys :-)
--
Matthew Wilcox <willy@bofh.ai>
"Windows and MacOS are products, contrived by engineers in the service of
specific companies. Unix, by contrast, is not so much a product as it is a
painstakingly compiled oral history of the hacker subculture." - N Stephenson
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [parisc-linux] utssys?
1999-08-07 13:31 [parisc-linux] utssys? Matthew Wilcox
@ 1999-08-07 15:45 ` John David Anglin
1999-08-08 1:38 ` Stan Sieler
1999-08-10 21:58 ` Kevin Vajk
2 siblings, 0 replies; 7+ messages in thread
From: John David Anglin @ 1999-08-07 15:45 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: parisc-linux
>
>
> Can anyone tell me what the utssys() system call does? There's no manual
> page for it. From tusc, I can see:
>
> utssys("HP-UX", 0, 0) ............................................ = 0
Just guessing but it might be for uname and setuname.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [parisc-linux] utssys?
1999-08-07 13:31 [parisc-linux] utssys? Matthew Wilcox
1999-08-07 15:45 ` John David Anglin
@ 1999-08-08 1:38 ` Stan Sieler
1999-08-08 3:34 ` John David Anglin
1999-08-10 21:58 ` Kevin Vajk
2 siblings, 1 reply; 7+ messages in thread
From: Stan Sieler @ 1999-08-08 1:38 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: parisc-linux
Re:
> Can anyone tell me what the utssys() system call does? There's no manual
> page for it. From tusc, I can see:
>
> utssys("HP-UX", 0, 0) ............................................ = 0
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [parisc-linux] utssys?
1999-08-08 1:38 ` Stan Sieler
@ 1999-08-08 3:34 ` John David Anglin
0 siblings, 0 replies; 7+ messages in thread
From: John David Anglin @ 1999-08-08 3:34 UTC (permalink / raw)
To: Stan Sieler; +Cc: Matthew.Wilcox, parisc-linux
>
> Re:
>
> > Can anyone tell me what the utssys() system call does? There's no manual
> > page for it. From tusc, I can see:
> >
> > utssys("HP-UX", 0, 0) ............................................ = 0
>
> >From decompiling, it doesn't appear to do much. The kernel utssys
> routine (called to handle system call (SYS_utssys, #57)), is short,
> with one external call ... to a short routine that has no procedure calls
> at all. That's where I stopped looking.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [parisc-linux] utssys?
@ 1999-08-08 23:18 Gyula Matics
0 siblings, 0 replies; 7+ messages in thread
From: Gyula Matics @ 1999-08-08 23:18 UTC (permalink / raw)
To: parisc-linux
> Can anyone tell me what the utssys() system call does? There's no manual
> page for it. From tusc, I can see:
>
> utssys("HP-UX", 0, 0) ............................................ = 0
>
> so all I need do to get it to work on Linux is return 0, but I'd like
> to understand a little more.
On Solaris it's 3 syscalls, and you have some documentation in sys/syscall.h
and sys/utssys.h. One of them is used by fuser.
Maybe you can find some info in the hpux headers?
(Can't check, no access for hpux right now)
int utssys(char *path, int flags, int type, char *obuf)
#define SYS_utssys 57
/*
*subcodes (third argument):
* uname(obuf) (obsolete) :: syscall(57, obuf, ign, 0)
* subcode 1 unused
* ustat(dev, obuf) :: syscall(57, obuf, dev, 2)
* fusers(path, flags, obuf) :: syscall(57, path, flags, 3, obuf)
* see <sys/utssys.h>
*/
Gyula
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [parisc-linux] utssys?
1999-08-07 13:31 [parisc-linux] utssys? Matthew Wilcox
1999-08-07 15:45 ` John David Anglin
1999-08-08 1:38 ` Stan Sieler
@ 1999-08-10 21:58 ` Kevin Vajk
1999-08-10 22:09 ` Kevin Vajk
2 siblings, 1 reply; 7+ messages in thread
From: Kevin Vajk @ 1999-08-10 21:58 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: parisc-linux
On Sat, 7 Aug 1999, Matthew Wilcox wrote:
> Can anyone tell me what the utssys() system call does? There's no manual
> page for it.
It takes 3 arguments; a pointer, and two ints.
The second int is the request type. If an unknown request type is
passed in, it returns EFAULT.
If the request does something like sets the hostname, the first int
passed in is the number of bytes in the hostname.
If the request does something like gets the hostname, the first int
passed in is the size of the character buffer for it to put the answer in.
Otherwise it's ignored.
type=0 gets the utsname (see sys/utsname.h). first int is ignored.
type=1 is obsolete; it returns EFAULT
I don't know what type=2 does.
type=3 sets utsname.nodename, if you're root
type=4 sets the hostname, if you're root
type=5 gets the hostname
type=6 sets utsname.sysname, if you're root
type=7 is undocumented; it's only used during OS updates. Just return EFAULT.
Here's an example of using utssys() to get the system's hostname:
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <syscall.h>
int main(argc,argv)
int argc; char *argv[];
{
char buf[2048];
memset(buf, 0, sizeof(buf));
/* utssys(buf, sizeof(buf), 5); */
if( syscall( SYS_UTSSYS, buf, sizeof(buf)-1, 5 ) == -1 ) {
perror("utssys");
exit(1);
}
printf("Hostname = \"%s\"\n", buf);
exit(0);
}
- Kevin Vajk
<kvajk@cup.hp.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [parisc-linux] utssys?
1999-08-10 21:58 ` Kevin Vajk
@ 1999-08-10 22:09 ` Kevin Vajk
0 siblings, 0 replies; 7+ messages in thread
From: Kevin Vajk @ 1999-08-10 22:09 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: parisc-linux
On Tue, 10 Aug 1999, Kevin Vajk wrote:
> I don't know what type=2 does.
Whoops! Yes, I do...
It implements ustat(). First argument is the dev, like this:
ustat(dev, buf) ==> utssys(buf, dev, 2)
- Kevin Vajk
<kvajk@cup.hp.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~1999-08-10 22:10 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-08-07 13:31 [parisc-linux] utssys? Matthew Wilcox
1999-08-07 15:45 ` John David Anglin
1999-08-08 1:38 ` Stan Sieler
1999-08-08 3:34 ` John David Anglin
1999-08-10 21:58 ` Kevin Vajk
1999-08-10 22:09 ` Kevin Vajk
-- strict thread matches above, loose matches on Subject: below --
1999-08-08 23:18 Gyula Matics
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox