Blame support/xunistd.h

Packit 6c4009
/* POSIX-specific extra functions.
Packit 6c4009
   Copyright (C) 2016-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
/* These wrapper functions use POSIX types and therefore cannot be
Packit 6c4009
   declared in <support/support.h>.  */
Packit 6c4009
Packit 6c4009
#ifndef SUPPORT_XUNISTD_H
Packit 6c4009
#define SUPPORT_XUNISTD_H
Packit 6c4009
Packit 6c4009
#include <sys/cdefs.h>
Packit 6c4009
#include <sys/types.h>
Packit 6c4009
#include <unistd.h>
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
Packit 6c4009
Packit 6c4009
struct stat64;
Packit 6c4009
Packit 6c4009
pid_t xfork (void);
Packit 6c4009
pid_t xwaitpid (pid_t, int *status, int flags);
Packit 6c4009
void xpipe (int[2]);
Packit 6c4009
void xdup2 (int, int);
Packit 6c4009
int xopen (const char *path, int flags, mode_t);
Packit 6c4009
void xstat (const char *path, struct stat64 *);
Packit 6c4009
void xfstat (int fd, struct stat64 *);
Packit 6c4009
void xmkdir (const char *path, mode_t);
Packit 6c4009
void xchroot (const char *path);
Packit 6c4009
void xunlink (const char *path);
Packit 6c4009
long xsysconf (int name);
Packit 6c4009
long long xlseek (int fd, long long offset, int whence);
Packit 6c4009
void xftruncate (int fd, long long length);
Packit Service ada5e0
void xsymlink (const char *target, const char *linkpath);
Packit Service ada5e0
Packit Service ada5e0
/* Equivalent of "mkdir -p".  */
Packit Service ada5e0
void xmkdirp (const char *, mode_t);
Packit 6c4009
Packit 6c4009
/* Read the link at PATH.  The caller should free the returned string
Packit 6c4009
   with free.  */
Packit 6c4009
char *xreadlink (const char *path);
Packit 6c4009
Packit 6c4009
/* Close the file descriptor.  Ignore EINTR errors, but terminate the
Packit 6c4009
   process on other errors.  */
Packit 6c4009
void xclose (int);
Packit 6c4009
Packit 6c4009
/* Write the buffer.  Retry on short writes.  */
Packit 6c4009
void xwrite (int, const void *, size_t);
Packit 6c4009
Packit 6c4009
/* Invoke mmap with a zero file offset.  */
Packit 6c4009
void *xmmap (void *addr, size_t length, int prot, int flags, int fd);
Packit 6c4009
void xmprotect (void *addr, size_t length, int prot);
Packit 6c4009
void xmunmap (void *addr, size_t length);
Packit 6c4009
Packit Service ada5e0
ssize_t xcopy_file_range(int fd_in, loff_t *off_in, int fd_out,
Packit Service ada5e0
			 loff_t *off_out, size_t len, unsigned int flags);
Packit Service ada5e0
Packit 6c4009
__END_DECLS
Packit 6c4009
Packit 6c4009
#endif /* SUPPORT_XUNISTD_H */