I believe you are supplying the wrong parameters.

It seems the output structure consists of an integer followed
by the sysname; you probably ran it on a big-endian
machine, so the first (high) byte of the output integer
was 0 - a null string.

I found a test program that happens to use just this: (the
use of lpioctl is because I didn't care if it couldn't run on an
NFS client...)

=============== sy.c
#include <afs/param.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <afs/venus.h>
main()
{
        struct ViceIoctl blob;
        struct {
                int32 setp;
                char data[512];
        } space;
        long code;

        space.setp = 0;
        blob.in = (char*)&space;
        blob.out = (char*)&space;
        blob.out_size = sizeof space;
        blob.in_size = sizeof space.setp;
        code = lpioctl(0, VIOC_AFS_SYSNAME, &blob, 1);
        if (code)
                printf ("sysname failed: %s\n", error_message(code));
        else if (!space.setp)
                printf ("no sysname value was found\n");
        else printf ("Current sysname is <%s>\n", space.data);
        exit(0);
}
=============== Makefile
        AFS=your AFS client library & include area/
        sy: sy.o
                cc -o sy sy.o ${AFS}lib/afs/libsys.a ${AFS}lib/afs/libcom_err.a
        sy.o: sy.c
                cc -I${AFS}include -c afs sy.c
===============

                                -Marcus

Reply via email to