afd
FILE *afd;
if ((afd = fopen(ALIASFILE, "r")) == NULL) {
while (fgets(line, sizeof (line), afd) != NULL) {
if (fclose(afd) == EOF) {
int afd = 0;
afd = attropen(fnamep, dtp->d_name, O_RDONLY);
if (afd == -1) {
(void) output_xattr_header(fullname, dtp->d_name, afd,
if ((actual_size = read(afd, buf, read_size)) < 0)
(void) close(afd);
afd = -1;
if (afd > 0)
(void) close(afd);
int afd;
else if ((afd = sm_io_getinfo(df, SM_IO_WHAT_FD, NULL)) < 0)
else if (fsync(afd) < 0)
static int afd = -1;
if (afd == -1 || lseek(afd, 0L, SEEK_SET) == -1)
afd = open(_PATH_AVENRUN, O_RDONLY|O_SYNC);
if (afd < 0)
r = read(afd, &avenrun, sizeof(avenrun));
int afd;
else if ((afd = sm_io_getinfo(e->e_dfp, SM_IO_WHAT_FD, NULL)) >= 0
&& fsync(afd) < 0)
int afd;
else if ((afd = sm_io_getinfo(df, SM_IO_WHAT_FD, NULL)) < 0)
else if (fsync(afd) < 0)
(void) close(cmd_info->afd);
if ((cmd_info->afd = fd = open(arnam, O_RDONLY)) == -1) {
int fd = cmd_info->afd;
int afd; /* fd for the archive file */
static const struct afd *
const struct afd *afd;
for (afd = afdl; afd->a_af; afd++) {
if (afd->a_af == af)
return afd;
const struct afd *afd;
afd = find_afd(af);
if (afd == NULL)
afd = find_afd(af);
if (afd == NULL)
GET_AI(cur->ai_next, afd, ap);
const struct afd *afd;
afd = find_afd(pai->ai_family);
if (afd == NULL)
return(get_ai(pai, afd, cp));
const struct afd *, const char *));
static const struct afd *find_afd __P((int));
#define GET_AI(ai, afd, addr) \
(ai) = get_ai(pai, (afd), (addr)); \
const struct afd *afd;
afd = find_afd(pai->ai_family);
if (afd == NULL)
GET_AI(cur->ai_next, afd, afd->a_addrany);
GET_AI(cur->ai_next, afd, afd->a_loopback);
const struct afd *afd;
afd = find_afd(pai->ai_family);
if (afd == NULL)
switch (afd->a_af) {
if (pai->ai_family == afd->a_af ||
GET_AI(cur->ai_next, afd, pton);
if (inet_pton(afd->a_af, hostname, pton) == 1) {
if (pai->ai_family == afd->a_af ||
GET_AI(cur->ai_next, afd, pton);
const struct afd *afd;
afd = find_afd(pai->ai_family);
if (afd == NULL)
if (!afd->a_scoped)
get_ai(pai, afd, addr)
const struct afd *afd;
+ (afd->a_socklen));
memset(ai->ai_addr, 0, (size_t)afd->a_socklen);
ai->ai_addr->sa_len = afd->a_socklen;
ai->ai_addrlen = afd->a_socklen;
ai->ai_addr->sa_family = ai->ai_family = afd->a_af;
memcpy(p + afd->a_off, addr, (size_t)afd->a_addrlen);
struct afd *afd;
afd = &afdl[i];
if (salen != afd->a_socklen) return EAI_FAIL;
addr = (const char *)sa + afd->a_off;
hp = gethostbyaddr(addr, afd->a_addrlen, afd->a_af);
switch(afd->a_af) {
if (inet_ntop(afd->a_af, addr, numaddr,
int newfd, dirfd, afd;
afd = attropen(file, SMB_QUOTA_CNTRL_INDEX_XATTR, O_RDWR | O_CREAT,
if (afd == -1) {
(void) close(afd);
int afd = -1;
if ((afd = openat(fd, "xattr", O_CREAT | O_RDWR | O_XATTR, 0777)) < 0) {
if (write(afd, pbuf, 1024) < 1024) {
(void) close(afd);
afd_t *afd = &curthread->t_activefd;
for (i = 0; i < afd->a_nfd; i++) {
ASSERT(afd->a_fd[i] == -1);
afd->a_fd[i] = -1;
afd->a_stale = 0;
free_afd(afd_t *afd) /* called below and from thread_free() */
if (afd->a_nfd > sizeof (afd->a_buf) / sizeof (afd->a_buf[0])) {
kmem_free(afd->a_fd, afd->a_nfd * sizeof (afd->a_fd[0]));
afd->a_fd = &afd->a_buf[0];
afd->a_nfd = sizeof (afd->a_buf) / sizeof (afd->a_buf[0]);
afd->a_stale = 0;
for (i = 0; i < afd->a_nfd; i++)
afd->a_fd[i] = -1;
afd_t *afd = &curthread->t_activefd;
if (afd->a_nfd == 0) { /* first time initialization */
mutex_enter(&afd->a_fdlock);
free_afd(afd);
mutex_exit(&afd->a_fdlock);
for (i = 0; i < afd->a_nfd; i++) {
if (afd->a_fd[i] == -1) {
afd->a_fd[i] = fd;
old_nfd = afd->a_nfd;
old_fd = afd->a_fd;
new_fd = kmem_alloc(new_nfd * sizeof (afd->a_fd[0]), KM_SLEEP);
mutex_enter(&afd->a_fdlock);
afd->a_fd = new_fd;
afd->a_nfd = new_nfd;
afd->a_fd[i] = old_fd[i];
afd->a_fd[i] = fd;
mutex_exit(&afd->a_fdlock);
if (old_nfd > sizeof (afd->a_buf) / sizeof (afd->a_buf[0])) {
kmem_free(old_fd, old_nfd * sizeof (afd->a_fd[0]));
afd_t *afd = &curthread->t_activefd;
for (i = 0; i < afd->a_nfd; i++) {
if (afd->a_fd[i] == fd) {
afd->a_fd[i] = -1;
ASSERT(i < afd->a_nfd); /* not found is not ok */
afd_t *afd = &t->t_activefd;
mutex_enter(&afd->a_fdlock);
for (i = 0; i < afd->a_nfd; i++) {
if (afd->a_fd[i] == fd) {
mutex_exit(&afd->a_fdlock);
mutex_exit(&afd->a_fdlock);
extern void free_afd(afd_t *afd);