limb 0.2.0

2024-01-09

open2(3)
limb manual
open2(3)

NAME

open2, open2_at, open3, open3_at - wrappers around open that can't be interrupted by signals

SYNOPSIS

#include <limb/djbunix.h>
int open2(const char *file, unsigned flags)
int open3(const char *file, unsigned flags, unsigned mode)

int open2_at(int fd, const char *file, int flags)
int open3_at(int fd, const char *file, int flags, unsigned mode)

DESCRIPTION

The open2() function is a wrapper around open(2) that takes 2 arguments, and cannot be interrupted by signals, i.e. if open(3) fails with EINTR a new call is automatically being made until it either succeeds or fails with a different error.

The open3() function is similar to open2() only it takes a third argument.

The open2_at() function is similar to open2() except when file is a relative path, in which case it is relative to the directory associated with the file descriptor fd, which may be AT_FDCWD to use the current working directory.

The open3_at() function is similar to open3() except when file is a relative path, in which case it is relative to the directory associated with the file descriptor fd, which may be AT_FDCWD to use the current working directory.

RETURN VALUE

Upon successful completion, these functions return the file descriptor associated with the opened file. Otherwise they return -1 and set errno to indicate the error.

ERRORS

The open2() and open3() functions may fail and set errno for any of the errors specified for open(3).

The open2_at() and open3_at() functions may fail and set errno for any of the errors specified for openat(3).

limb 0.1.0
2023-07-24
open2(3)