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
20
votes
3 answers

How to implement 'set -o pipefail' in a POSIX way - almost done, expert help needed

I have to implement the BASH set -o pipefail option in a POSIX way so that it works on various LINUX/UNIX flavors. To explain a bit, this option enables the user to verify the successful execution of all piped commands. With this option enabled this…
tom.bujok
  • 1,612
  • 2
  • 13
  • 20
20
votes
5 answers

Are there any well-behaved POSIX interval timers?

Inspired by the last leap second, I've been exploring timing (specifically, interval timers) using POSIX calls. POSIX provides several ways to set up timers, but they're all problematic: sleep and nanosleep—these are annoying to restart after…
Left For Archive
  • 2,626
  • 1
  • 18
  • 19
20
votes
4 answers

How does one easily add posix support to PHP using yum?

I am running CentOS 5.2 and using yum to manage packages. I have had little luck installing php-posix but know with almost 100% certitude that it is a real and available package...somewhere. Has anyone had luck installing it? FWIW, I am using the…
Kyle
  • 1,054
  • 2
  • 14
  • 27
19
votes
3 answers

two file descriptors to same file

Using the posix read() write() linux calls, is it guaranteed that if I write through one file descriptor and read through another file descriptor, in a serial fashion such that the two actions are mutually exclusive of each other... that my read…
Michael Xu
  • 557
  • 1
  • 5
  • 14
19
votes
2 answers

Regex Syntax changes between POSIX and PCRE

We are currently in the process of upgrading our Varnish Cache servers. As part of the process, we upgraded only one of them to see how it behaves compared to the older versions. Some of the major changes made in this new version is changing the…
Ken
  • 691
  • 5
  • 14
19
votes
1 answer

Why do shells ignore SIGINT and SIGQUIT in backgrounded processes?

If I background a processes in a script or a -c snippet, the backgrounded processes ignores SIGINT and SIGQUIT: Example: $ alias ps='ps -o pid,ppid,pgrp,sid,stat,tty,ignored,blocked,caught,wchan,min_flt,pmem,args --forest' $ sh -c 'sleep 1000 &…
Petr Skocik
  • 58,047
  • 6
  • 95
  • 142
19
votes
3 answers

What are the POSIX cancellation points?

What are the POSIX cancellation points? I'm looking for a definitive list of POSIX cancellation points. I'm asking because I have a book that says accept() and select() are cancellation points, but I've seen sites on the internet claim that they are…
Corin Fletcher
  • 1,611
  • 1
  • 17
  • 25
19
votes
1 answer

open(2) function hangs when trying to open serial port in MacOS

I've run into a problem where the open function never returns when I try to open a serial port. It doesn't happen all the time, and the problem disappears for a while if I unplug my USB to serial adapter and plug it back in. My code looks like…
Andrew Madsen
  • 21,309
  • 5
  • 56
  • 97
19
votes
4 answers

How to durably rename a file in POSIX?

What's the correct way to durably rename a file in a POSIX file system? Specifically wondering about fsyncs on the directories. (If this depends on the OS/FS, I'm asking about Linux and ext3/ext4). Note: there are other questions on StackOverflow…
Yang
  • 16,037
  • 15
  • 100
  • 142
19
votes
3 answers

POSIX API call to list all the pthreads running in a process

I have a multi-threaded application in a POSIX/Linux environment - I have no control over the code that creates the pthreads. At some point the process - owner of the pthreads - receives a signal. The handler of that signal should abort,cancel or…
Manuel Salvadores
  • 16,287
  • 5
  • 37
  • 56
19
votes
3 answers

Maven assembly-plugin "group id '1377585961' is too big" error

I'm trying to understand why only one (new) MacBookPro in our dev-team, running OS-X 10.10.5, is having a problem completing the Assemble phase of a Project that no other MacBook on the project is having. I'm wondering if anyone else run into this…
CelticPoet
  • 588
  • 1
  • 5
  • 13
19
votes
4 answers

Non-blocking socket with poll

A couple of days ago I had to investigate a problem where my application was showing abnormally high CPU usage when it was (apparently) in idle state. I tracked the problem down to a loop which was meant to block on a recvfrom call while the socket…
341008
  • 9,862
  • 11
  • 52
  • 84
19
votes
6 answers

Why use select() instead of sleep()?

I'm working through a chapter about iPhone audio and have come across a section of code that I can't make sense of: while (aqc.playPtr < aqc.sampleLen) { select(NULL, NULL, NULL, NULL, 1.0); } (Full code sample is on pages 163-166). From what…
Benedict Cohen
  • 11,912
  • 7
  • 55
  • 67
19
votes
5 answers

What libraries need to be linked for timer_create, timer_settime and other timer related functions

Compiling a program on Linux that calls POSIX timer functions (eg: timer_create, timer_settime) returns errors such as: In function `foo': timer.c:(.text+0xbb): undefined reference to `timer_create' timer.c:(.text+0x187): undefined reference to…
Foo Bar
19
votes
3 answers

Is intmax_t the same as long long int?

By POSIX, intmax_t designates a signed integer type capable of representing any value of any signed integer type. Would it be correct that in C99/C11 that intmax_t is always the same size as long long int?
countunique
  • 4,068
  • 6
  • 26
  • 35