/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2012 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> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
#include "asohdr.h"
#else
#include <fcntl.h>
#include <unistd.h>
typedef struct APL_s
{
int fd;
char path[1];
} APL_t;
static void*
{
char* path;
char* opt;
int n;
int fd;
int drop;
int perm;
char tmp[64];
if (apl)
{
{
references = 0;
references = 0;
else if (references > 0)
{
references--;
references = 0;
references = 0;
}
if (!references)
}
return 0;
}
fd = -1;
drop = 0;
{
{
n = sizeof(tmp) - 1;
tmp[n] = 0;
}
{
if (size <= sizeof(references))
goto bad;
size -= sizeof(references);
}
}
{
return 0;
drop = 1;
}
goto bad;
if (fd >= 0 || (fd = open(path, O_RDWR|O_cloexec)) < 0 && (fd = open(path, O_CREAT|O_RDWR|O_cloexec, perm)) >= 0)
{
goto bad;
references = 1;
goto bad;
}
else
{
goto bad;
size -= sizeof(references);
goto bad;
goto bad;
goto bad;
references++;
goto bad;
goto bad;
}
return apl;
bad:
if (apl)
if (fd >= 0)
if (drop)
return 0;
}
static ssize_t
{
if (!apl)
return -1;
if (k > 0)
else
{
}
}
#endif