104 // is longer than PATH_MAX. |
104 // is longer than PATH_MAX. |
105 // On success, returns 'outbuf', which now contains the path. |
105 // On success, returns 'outbuf', which now contains the path. |
106 // On error, it will return NULL and set errno. The content of 'outbuf' is undefined. |
106 // On error, it will return NULL and set errno. The content of 'outbuf' is undefined. |
107 // On truncation error ('outbuf' too small), it will return NULL and set errno to ENAMETOOLONG. |
107 // On truncation error ('outbuf' too small), it will return NULL and set errno to ENAMETOOLONG. |
108 static char* realpath(const char* filename, char* outbuf, size_t outbuflen); |
108 static char* realpath(const char* filename, char* outbuf, size_t outbuflen); |
|
109 |
|
110 // Returns true if given uid is root. |
|
111 static bool is_root(uid_t uid); |
|
112 |
|
113 // Returns true if given uid is effective or root uid. |
|
114 static bool matches_effective_uid_or_root(uid_t uid); |
|
115 |
|
116 // Returns true if either given uid is effective uid and given gid is |
|
117 // effective gid, or if given uid is root. |
|
118 static bool matches_effective_uid_and_gid_or_root(uid_t uid, gid_t gid); |
109 }; |
119 }; |
110 |
120 |
111 // On POSIX platforms the signal handler is global so we just do the write. |
121 // On POSIX platforms the signal handler is global so we just do the write. |
112 static void write_memory_serialize_page_with_handler(JavaThread* thread) { |
122 static void write_memory_serialize_page_with_handler(JavaThread* thread) { |
113 write_memory_serialize_page(thread); |
123 write_memory_serialize_page(thread); |