/* * Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. *
*/
// Note: the Posix API aims to capture functionality available on all Posix // compliant platforms, but in practice the implementations may depend on // non-Posix functionality. For example, the use of lseek64 and ftruncate64. // This use of non-Posix API's is made possible by compiling/linking in a mode // that is not restricted to being fully Posix complaint, such as by declaring // -D_GNU_SOURCE. But be aware that in doing so we may enable non-Posix // behaviour in API's that are defined by Posix. For example, that SIGSTKSZ // is not defined as a constant as of Glibc 2.34.
public: staticvoid init(void); // early initialization - no logging available staticvoid init_2(void);// later initialization - logging available
// Return default stack size for the specified thread type static size_t default_stack_size(os::ThreadType thr_type); static size_t get_initial_stack_size(ThreadType thr_type, size_t req_stack_size);
// Helper function; describes pthread attributes as short string. String is written // to buf with len buflen; buf is returned. staticchar* describe_pthread_attr(char* buf, size_t buflen, const pthread_attr_t* attr);
// A safe implementation of realpath which will not cause a buffer overflow if the resolved path // is longer than PATH_MAX. // On success, returns 'outbuf', which now contains the path. // On error, it will return NULL and set errno. The content of 'outbuf' is undefined. // On truncation error ('outbuf' too small), it will return NULL and set errno to ENAMETOOLONG. staticchar* realpath(constchar* filename, char* outbuf, size_t outbuflen);
// Returns true if given uid is root. staticbool is_root(uid_t uid);
// Returns true if given uid is effective or root uid. staticbool matches_effective_uid_or_root(uid_t uid);
// Returns true if either given uid is effective uid and given gid is // effective gid, or if given uid is root. staticbool matches_effective_uid_and_gid_or_root(uid_t uid, gid_t gid);
// Set PC into context. Needed for continuation after signal. static address ucontext_get_pc(const ucontext_t* ctx); staticvoid ucontext_set_pc(ucontext_t* ctx, address pc);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.