/** \file fd.h exported symbols from fd.c */
-int write_all(int fd, const char *buf, size_t *len);
int para_open(const char *path, int flags, mode_t mode);
int para_opendir(const char *dirname, DIR **dir, int *cwd);
int para_mkdir(const char *path, mode_t mode);
*
* \sa lseek(2).
*/
-int para_lseek(int fd, off_t *offset, int whence)
+static int __lseek(int fd, off_t *offset, int whence)
{
*offset = lseek(fd, *offset, whence);
int ret = -E_LSEEK;
*
* \sa write(2).
*/
-ssize_t para_write(int fd, const void *buf, size_t size)
+static ssize_t __write(int fd, const void *buf, size_t size)
{
ssize_t ret;
*
* \sa para_write().
*/
-ssize_t para_write_all(int fd, const void *buf, size_t size)
+static ssize_t write_all(int fd, const void *buf, size_t size)
{
// DEBUG_LOG("writing %zu bytes\n", size);
const char *b = buf;
while (size) {
- ssize_t ret = para_write(fd, b, size);
+ ssize_t ret = __write(fd, b, size);
// DEBUG_LOG("ret: %zd\n", ret);
if (ret < 0)
return ret;
if (ret < 0)
return ret;
fd = ret;
- ret = para_write_all(fd, buf, size);
+ ret = write_all(fd, buf, size);
if (ret < 0)
goto out;
ret = 1;
return ret;
fd = ret;
if (header && header_size) {
- ret = para_write_all(fd, header, header_size);
+ ret = write_all(fd, header, header_size);
if (ret < 0)
goto out;
}
- ret = para_write_all(fd, data, data_size);
+ ret = write_all(fd, data, data_size);
if (ret < 0)
goto out;
if (new_pos) {
off_t offset = 0;
- ret = para_lseek(fd, &offset, SEEK_END);
+ ret = __lseek(fd, &offset, SEEK_END);
if (ret < 0)
goto out;
// DEBUG_LOG("new file size: " FMT_OFF_T "\n", offset);