char buf[2 * MAX_PATH + 1];
buf[0] = buf[1] = buf[2] = buf[sizeof(buf) - 1] = '\0';
- if (! ReadFile (hnd, buf, sizeof (buf) - 1, &done, 0))
+ if (!ReadFile (hnd, buf, sizeof (buf) - 1, &done, 0))
{
CloseHandle (hnd);
__seterrno ();
{
/* Null terminate the initial command and step over
any additional white space. If we've hit the
- end of the line, exit the loop. Otherwise, position
- we've found the first argument. Position the current
+ end of the line, exit the loop. Otherwise, we've
+ found the first argument. Position the current
pointer on the last known white space. */
*ptr = '\0';
char *newptr = ptr + 1;
cygwin_shared->delqueue.process_queue ();
}
-extern "C"
-int
+extern "C" int
_unlink (const char *ourname)
{
int res = -1;
return res;
}
-extern "C"
-pid_t
+extern "C" pid_t
_getpid ()
{
return myself->pid;
}
/* getppid: POSIX 4.1.1.1 */
-extern "C"
-pid_t
+extern "C" pid_t
getppid ()
{
return myself->ppid;
}
/* setsid: POSIX 4.3.2.1 */
-extern "C"
-pid_t
+extern "C" pid_t
setsid (void)
{
/* FIXME: for now */
return res;
}
-extern "C"
-int
+extern "C" int
_write (int fd, const void *ptr, size_t len)
{
int res = -1;
* these.
*/
-extern "C"
-ssize_t
+extern "C" ssize_t
writev (int fd, const struct iovec *iov, int iovcnt)
{
int i;
* these.
*/
-extern "C"
-ssize_t
+extern "C" ssize_t
readv (int fd, const struct iovec *iov, int iovcnt)
{
int i;
/* _open */
/* newlib's fcntl.h defines _open as taking variable args so we must
correspond. The third arg if it exists is: mode_t mode. */
-extern "C"
-int
+extern "C" int
_open (const char *unix_path, int flags, ...)
{
int fd;
return res;
}
-extern "C"
-off_t
+extern "C" off_t
_lseek (int fd, off_t pos, int dir)
{
off_t res;
return res;
}
-extern "C"
-int
+extern "C" int
_close (int fd)
{
int res;
return res;
}
-extern "C"
-int
+extern "C" int
isatty (int fd)
{
int res;
we should just copy the file.
*/
-extern "C"
-int
+extern "C" int
_link (const char *a, const char *b)
{
int res = -1;
return res;
}
-extern "C"
-int
+extern "C" int
chown (const char * name, uid_t uid, gid_t gid)
{
return chown_worker (name, PC_SYM_FOLLOW, uid, gid);
}
-extern "C"
-int
+extern "C" int
lchown (const char * name, uid_t uid, gid_t gid)
{
return chown_worker (name, PC_SYM_IGNORE, uid, gid);
}
-extern "C"
-int
+extern "C" int
fchown (int fd, uid_t uid, gid_t gid)
{
if (fdtab.not_open (fd))
}
/* umask: POSIX 5.3.3.1 */
-extern "C"
-mode_t
+extern "C" mode_t
umask (mode_t mask)
{
mode_t oldmask;
}
/* chmod: POSIX 5.6.4.1 */
-extern "C"
-int
+extern "C" int
chmod (const char *path, mode_t mode)
{
int res = -1;
/* fchmod: P96 5.6.4.1 */
-extern "C"
-int
+extern "C" int
fchmod (int fd, mode_t mode)
{
if (fdtab.not_open (fd))
return count;
}
-extern "C"
-int
+extern "C" int
_fstat (int fd, struct stat *buf)
{
int r;
}
/* fsync: P96 6.6.1.1 */
-extern "C"
-int
+extern "C" int
fsync (int fd)
{
if (fdtab.not_open (fd))
}
/* sync: standards? */
-extern "C"
-int
+extern "C" int
sync ()
{
return 0;
return res;
}
-extern "C"
-int
+extern "C" int
_stat (const char *name, struct stat *buf)
{
return stat_worker ("stat", name, buf, 0);
}
/* lstat: Provided by SVR4 and 4.3+BSD, POSIX? */
-extern "C"
-int
+extern "C" int
lstat (const char *name, struct stat *buf)
{
return stat_worker ("lstat", name, buf, 1);
extern int acl_access (const char *, int);
-extern "C"
-int
+extern "C" int
access (const char *fn, int flags)
{
// flags were incorrectly specified
return r;
}
-extern "C"
-int
+extern "C" int
_rename (const char *oldpath, const char *newpath)
{
int res = 0;
return res;
}
-extern "C"
-int
+extern "C" int
system (const char *cmdstring)
{
int res;
return res;
}
-extern "C"
-void
+extern "C" void
setdtablesize (int size)
{
if (size > (int)fdtab.size)
fdtab.extend (size);
}
-extern "C"
-int
+extern "C" int
getdtablesize ()
{
return fdtab.size;
}
-extern "C"
-size_t
+extern "C" size_t
getpagesize ()
{
return sysconf (_SC_PAGESIZE);
}
/* FIXME: not all values are correct... */
-extern "C"
-long int
+extern "C" long int
fpathconf (int fd, int v)
{
switch (v)
}
}
-extern "C"
-long int
+extern "C" long int
pathconf (const char *file, int v)
{
switch (v)
}
/* setegid: from System V. */
-extern "C"
-int
+extern "C" int
setegid (gid_t gid)
{
if (os_being_run == winNT)
/* chroot: privileged Unix system call. */
/* FIXME: Not privileged here. How should this be done? */
-extern "C"
-int
+extern "C" int
chroot (const char *newroot)
{
int ret = -1;
return ret;
}
-extern "C"
-int
+extern "C" int
creat (const char *path, mode_t mode)
{
return open (path, O_WRONLY | O_CREAT | O_TRUNC, mode);
}
-extern "C"
-void
+extern "C" void
__assertfail ()
{
exit (99);
}
-extern "C"
-int
+extern "C" int
getw (FILE *fp)
{
int w, ret;
return ret != 1 ? EOF : w;
}
-extern "C"
-int
+extern "C" int
putw (int w, FILE *fp)
{
int ret;
return 0;
}
-extern "C"
-int
+extern "C" int
wcscmp (const wchar_t *s1, const wchar_t *s2)
{
while (*s1 && *s1 == *s2)
return (*(unsigned short *) s1) - (*(unsigned short *) s2);
}
-extern "C"
-size_t
+extern "C" size_t
wcslen (const wchar_t *s1)
{
int l = 0;
/* FIXME: to do this right, maybe work out the usoft va_list machine
and use wsvprintfW instead?
*/
-extern "C"
-int
+extern "C" int
wprintf (const char *fmt, ...)
{
va_list ap;
return ret;
}
-extern "C"
-int
+extern "C" int
vhangup ()
{
set_errno (ENOSYS);
return -1;
}
-extern "C"
-_PTR
+extern "C" _PTR
memccpy (_PTR out, const _PTR in, int c, size_t len)
{
const char *inc = (char *) in;
return 0;
}
-extern "C"
-int
+extern "C" int
nice (int incr)
{
DWORD priority[] =
* Find the first bit set in I.
*/
-extern "C"
-int
+extern "C" int
ffs (int i)
{
static const unsigned char table[] =
return table[x >> a] + a;
}
-extern "C"
-void
+extern "C" void
login (struct utmp *ut)
{
register int fd;
/* It isn't possible to use unix-style I/O function in logout code because
cygwin's I/O subsystem may be inaccessible at logout() call time.
+FIXME (cgf): huh?
*/
-extern "C"
-int
+extern "C" int
logout (char *line)
{
int res = 0;