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

Side by Side Diff: runtime/bin/fdutils.h

Issue 11416006: Added FD_CLOEXEC flag to client/server socket file descriptors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/bin/fdutils_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef BIN_FDUTILS_H_ 5 #ifndef BIN_FDUTILS_H_
6 #define BIN_FDUTILS_H_ 6 #define BIN_FDUTILS_H_
7 7
8 #include "bin/builtin.h" 8 #include "bin/builtin.h"
9 #include "platform/globals.h" 9 #include "platform/globals.h"
10 10
11 class FDUtils { 11 class FDUtils {
12 public: 12 public:
13 static bool SetCloseOnExec(intptr_t fd);
14
13 static bool SetNonBlocking(intptr_t fd); 15 static bool SetNonBlocking(intptr_t fd);
14 static bool SetBlocking(intptr_t fd); 16 static bool SetBlocking(intptr_t fd);
15 17
16 // Checks whether the file descriptor is blocking. If the function 18 // Checks whether the file descriptor is blocking. If the function
17 // returns true the value pointed to by is_blocking will be set to 19 // returns true the value pointed to by is_blocking will be set to
18 // the blocking state of the file descriptor. If the function 20 // the blocking state of the file descriptor. If the function
19 // returns false the system call for checking the file descriptor 21 // returns false the system call for checking the file descriptor
20 // failed and the value pointed to by is_blocking is not modified. 22 // failed and the value pointed to by is_blocking is not modified.
21 static bool IsBlocking(intptr_t fd, bool* is_blocking); 23 static bool IsBlocking(intptr_t fd, bool* is_blocking);
22 24
(...skipping 10 matching lines...) Expand all
33 // which case it returns -1 and errno is still valid. The file 35 // which case it returns -1 and errno is still valid. The file
34 // descriptor must be in blocking mode. 36 // descriptor must be in blocking mode.
35 static ssize_t WriteToBlocking(int fd, const void* buffer, size_t count); 37 static ssize_t WriteToBlocking(int fd, const void* buffer, size_t count);
36 38
37 private: 39 private:
38 DISALLOW_ALLOCATION(); 40 DISALLOW_ALLOCATION();
39 DISALLOW_IMPLICIT_CONSTRUCTORS(FDUtils); 41 DISALLOW_IMPLICIT_CONSTRUCTORS(FDUtils);
40 }; 42 };
41 43
42 #endif // BIN_FDUTILS_H_ 44 #endif // BIN_FDUTILS_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/fdutils_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698