cssend.c revision 3f54fd611f536639ec30dd53c48e5ec1897cc7d9
/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1990-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* Glenn Fowler
* AT&T Research
*
* send n fds to stream fd
*/
#include "cslib.h"
int
{
#if CS_LIB_STREAM || CS_LIB_V10
register int i;
if (n > 0)
{
#if CS_LIB_STREAM
#endif
#if CS_LIB_STREAM
#else
#endif
{
return -1;
}
for (i = 0; i < n; i++)
{
return -1;
}
}
return 0;
#else
register char* s;
register int i;
struct
{
#else
#define msg_control msg_accrights
#define msg_controllen msg_accrightslen
#endif
} ctl;
{
return -1;
}
/*
* the first fd is to verify uid,gid in csrecv()
*/
if (eaccess(s, X_OK) && (mkdir(s, S_IRWXU|S_IRWXG|S_IRWXO) || chmod(s, S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)))
{
return -1;
}
{
return -1;
}
{
return -1;
}
if (remove(s))
{
close(i);
return -1;
}
for (i = 0; i < n; i++)
msg.msg_namelen = 0;
#endif
#ifdef EMSGSIZE
n = 0;
sleep(1);
#else
#endif
return i;
#else
{
register int i;
register int j;
register char* s;
static struct
{
int* fds;
int num;
int max;
} hold;
/*
* the sent fd's must be kept open until
* the other side receives them, so we dup
* and hold them open until the next cssend()
*/
{
}
{
}
{
for (i = 0; i < n; i++)
{
j = fds[i];
}
}
else for (i = 0; i < n; i++)
return i;
}
return -1;
#endif
#endif
}
int
{
}