|
|
researchv9-SUN3(old)
/*LINTLIBRARY*/
/*
** Write a new ``shares'' file record from details in lnode.
**
** Returns 0 for illegal uid,
** SYSERROR for bad system call,
** else sizeof(Share).
*/
#include <sys/types.h>
#include <sys/lnode.h>
#include <shares.h>
#include <libc.h>
int
putshares(lp, extime)
register struct lnode * lp;
unsigned long extime;
{
register long posn;
Share share;
if ( lp->l_uid > MAXUID )
return 0;
if ( !openshares(1) )
return SYSERROR;
share.l = *lp;
share.extime = extime;
posn = sizeof(Share) * lp->l_uid;
if ( lseek(ShareFd, posn, 0) == SYSERROR )
return SYSERROR;
return write(ShareFd, &share, sizeof(Share));
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.