Questions tagged [posix]

POSIX (Portable Operating System Interface) is a set of standards defining programming APIs, a command interpreter, and common utilities for Unix-like operating systems.

POSIX (an acronym for "Portable Operating System Interface") is a family of standards that specifies the behaviour of Unix-like operating systems.

These standards define:

  • A standard operating system interface and environment
  • A programming API for the C programming language
  • The behavior of a command interpreter (or "shell")
  • The behavior of common utility programs invocable from the shell

The POSIX standards are developed by the Austin Common Standards Revision Group, a joint technical working group led by representatives from IEEE PASC, ISO/IEC JTC 1/SC 22, and The Open Group.

The current set of POSIX standards is available online.

POSIX is a trademark of the IEEE.

5973 questions
3
votes
2 answers

Passing user data with timer_create

I am using timer_create to create a timer in Linux. The callback prototype is: static void TimerHandlerCB(int sig, siginfo_t *extra, void *cruft) How can i pass user data so that i can receive the same in the callback called after timer expiry.…
Alok Save
  • 202,538
  • 53
  • 430
  • 533
3
votes
1 answer

Why signals are platform-dependent in Linux?

SIGNAL(7) man page states: The numeric value for each signal is given in the table below. As shown in the table, many signals have different numeric values on different architectures ... Indeed. In Linux kernel source we can ensure f.e.…
z0lupka
  • 236
  • 4
  • 19
3
votes
3 answers

Shell script: Portable way to programmably obtain the CPU vendor on POSIX systems

Is there a portable way to programmably obtain the CPU vendor info on POSIX systems in shell scripts? In particular, I need to tell whether an x86_64/AMD64 CPU is vended by Intel or AMD. The approach does not have to work on all POSIX systems, but…
xuhdev
  • 8,018
  • 2
  • 41
  • 69
3
votes
2 answers

aio on osx: Is it implemented in the kernel or with user threads? Other Options?

I am working on my small c++ framework and have a file class which should also support async reading and writing. The only solution other than using synchronous file i/o inside some worker threads I found is aio. Anyways I was looking around and…
moka
  • 4,353
  • 2
  • 37
  • 63
3
votes
1 answer

POSIX implementation of a named semaphore for IPC

I am working on a homework assignment involving implementing a semaphore to enforce mutual exclusion between child processes. I have most of the code working, except that I am not using the semaphore correctly. The articles I have found aren't…
jcampos12
  • 55
  • 5
3
votes
1 answer

Oracle APEX POSIX-implementation REGEX for Password Validation

I've probably read 20+ different flavors of this same question over the past 4 hours with no positive results. I'm trying to validate a password via regex in an Oracle APEX app which to my understanding uses a POSIX Implementation of regex which is…
Patrick
  • 7,512
  • 7
  • 39
  • 50
3
votes
1 answer

Text.Regex.Posix's =~ operator cannot get the return value in some patterns

Text.Regex.Posix's =~ operator cannot get the return value in some patterns. For example, > import Text.Regex.Posix > "y2019m10d08" =~ "y([0-9]{4})?m([0-9]{1,2})?d([0-9]{1,2})?" :: Bool True > "y2019m10d08" =~…
satun
  • 31
  • 2
3
votes
1 answer

Is ./*/ portable?

I often use ./*/ in a for loop like for d in ./*/; do : # do something with dirs done to match all non-hidden directories in current working directory, but I'm not really sure if this is a portable way to do that. I have bash, dash and ksh…
oguz ismail
  • 1
  • 16
  • 47
  • 69
3
votes
1 answer

POSIX condition variable & mutex "competition"

When a thread waits on a condition variable, the associated mutex is (atomically) released (unlocked). When that condition variable is signaled (by a different thread), one (for signal) or all (for broadcast) waiting thread(s) is/are awakened,…
ags
  • 719
  • 7
  • 23
3
votes
7 answers

POSIX Program to search entire file system for a file

Hey everyone. I need to write a POSIX program to search through an entire file system for a specified file starting at the top directory. I've got some code which isn't done at all, but when I run it, and check to see if a particular file is a…
Cuthbert
  • 2,908
  • 5
  • 33
  • 60
3
votes
1 answer

How do I find out which header/include declared what variables in source?

If I see a struct, typedef, const, or any other variable being used which was not explicitly declared in the source that I'm reading, is there a standard way in Linux to go about discovering which of the source's included header files provided the…
Omar Darwish
  • 1,536
  • 2
  • 15
  • 23
3
votes
2 answers

How can you clean an entire POSIX tree with only POSIX functions?

Having populated a POSIX binary tree with tsearch, how is it possible to clean-up the entire tree? GCC provides tdestroy as an extension, but if you want to use POSIX-only functions how can you do it? My current implementation uses twalk to walk the…
Marcus Harrison
  • 819
  • 6
  • 19
3
votes
1 answer

Execute two functions at the same time independently in C

I think I may have a threading problem in c, but I'm not sure. My goal is to execute two separate functions inside a while(1) loop as such: One of these functions is kbget() to retrieve the key pressed in a terminal in non-canonical mode. The…
sulla
  • 31
  • 2
3
votes
2 answers

I have a trouble with looking into the read() function code defined in

I am now trying to understand how read(2) function works by looking into the actual code implementation and first, I try to see how it is defined in #include header file. In that file, I found this : ssize_t read(int, void *, size_t)…
H.Potter
  • 137
  • 2
  • 9
3
votes
3 answers

(struct *) vs (void *) -- Funtion prototype equivalence in C11/C99

I was trying to implement GLOB_ALTDIRFUNC last night, and tripped into an interesting question. While maybe slightly semantically different, are (void *) and (struct *) types equivalent? Example code: typedef struct __dirstream DIR; struct dirent…
Ismael Luceno
  • 2,055
  • 15
  • 26