Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
d036e208
Commit
d036e208
authored
Aug 21, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
system/FileDescriptor: add openat() wrapper
parent
9151b84c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
FileDescriptor.cxx
src/system/FileDescriptor.cxx
+12
-0
FileDescriptor.hxx
src/system/FileDescriptor.hxx
+5
-0
No files found.
src/system/FileDescriptor.cxx
View file @
d036e208
...
...
@@ -76,6 +76,18 @@ FileDescriptor::IsSocket() const noexcept
#endif
#ifdef __linux
bool
FileDescriptor
::
Open
(
FileDescriptor
dir
,
const
char
*
pathname
,
int
flags
,
mode_t
mode
)
noexcept
{
fd
=
::
openat
(
dir
.
Get
(),
pathname
,
flags
|
O_NOCTTY
|
O_CLOEXEC
,
mode
);
return
IsDefined
();
}
#endif
bool
FileDescriptor
::
Open
(
const
char
*
pathname
,
int
flags
,
mode_t
mode
)
noexcept
{
...
...
src/system/FileDescriptor.hxx
View file @
d036e208
...
...
@@ -116,6 +116,11 @@ public:
return
FileDescriptor
(
-
1
);
}
#ifdef __linux
bool
Open
(
FileDescriptor
dir
,
const
char
*
pathname
,
int
flags
,
mode_t
mode
=
0666
)
noexcept
;
#endif
bool
Open
(
const
char
*
pathname
,
int
flags
,
mode_t
mode
=
0666
)
noexcept
;
#ifdef _WIN32
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment