Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(458)

Side by Side Diff: third_party/crashpad/crashpad/util/posix/close_multiple.h

Issue 2555353002: Update Crashpad to 32981a3ee9d7c2769fb27afa038fe2e194cfa329 (Closed)
Patch Set: fix readme Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Crashpad Authors. All rights reserved. 1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 10 matching lines...) Expand all
21 //! 21 //!
22 //! This is similar to the BSD/Solaris-style `closefrom()` routine, which closes 22 //! This is similar to the BSD/Solaris-style `closefrom()` routine, which closes
23 //! all open file descriptors equal to or higher than its \a fd argument. This 23 //! all open file descriptors equal to or higher than its \a fd argument. This
24 //! function must not be called while other threads are active. It is intended 24 //! function must not be called while other threads are active. It is intended
25 //! to be used in a child process created by `fork()`, prior to calling an 25 //! to be used in a child process created by `fork()`, prior to calling an
26 //! `exec()`-family function. This guarantees that a (possibly untrustworthy) 26 //! `exec()`-family function. This guarantees that a (possibly untrustworthy)
27 //! child process does not inherit file descriptors that it has no need for. 27 //! child process does not inherit file descriptors that it has no need for.
28 //! 28 //!
29 //! Unlike the BSD function, this function may not close file descriptors 29 //! Unlike the BSD function, this function may not close file descriptors
30 //! immediately, but may instead mark them as close-on-exec. The actual behavior 30 //! immediately, but may instead mark them as close-on-exec. The actual behavior
31 //! chosen is specific to the operating system. On Mac OS X, file descriptors 31 //! chosen is specific to the operating system. On macOS, file descriptors are
32 //! are marked close-on-exec instead of being closed outright in order to avoid 32 //! marked close-on-exec instead of being closed outright in order to avoid
33 //! raising `EXC_GUARD` exceptions for guarded file descriptors that are 33 //! raising `EXC_GUARD` exceptions for guarded file descriptors that are
34 //! protected against `close()`. 34 //! protected against `close()`.
35 //! 35 //!
36 //! \param[in] fd The lowest file descriptor to close or set as close-on-exec. 36 //! \param[in] fd The lowest file descriptor to close or set as close-on-exec.
37 //! \param[in] preserve_fd A file descriptor to preserve and not close (or set 37 //! \param[in] preserve_fd A file descriptor to preserve and not close (or set
38 //! as close-on-exec), even if it is open and its value is greater than \a 38 //! as close-on-exec), even if it is open and its value is greater than \a
39 //! fd. To not preserve any file descriptor, pass `-1` for this parameter. 39 //! fd. To not preserve any file descriptor, pass `-1` for this parameter.
40 void CloseMultipleNowOrOnExec(int fd, int preserve_fd); 40 void CloseMultipleNowOrOnExec(int fd, int preserve_fd);
41 41
42 } // namespace crashpad 42 } // namespace crashpad
43 43
44 #endif // CRASHPAD_UTIL_POSIX_CLOSE_MULTIPLE_H_ 44 #endif // CRASHPAD_UTIL_POSIX_CLOSE_MULTIPLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698