posix-api

How can I wait for any/all pthreads to complete?

半世苍凉 提交于 2019-11-28 05:17:55
I just want my main thread to wait for any and all my (p)threads to complete before exiting. The threads come and go a lot for different reasons, and I really don't want to keep track of all of them - I just want to know when they're all gone. wait() does this for child processes, returning ECHILD when there are no children left, however wait does not (appear to work with) (p)threads. I really don't want to go through the trouble of keeping a list of every single outstanding thread (as they come and go), then having to call pthread_join on each. As there a quick-and-dirty way to do this? The

Is O_LARGEFILE needed just to write a large file?

霸气de小男生 提交于 2019-11-27 23:02:05
Is the O_LARGEFILE flag needed if all that I want to do is write a large file ( O_WRONLY ) or append to a large file ( O_APPEND | O_WRONLY )? From a thread that I read titled " Cannot write >2gb index file " on the CLucene-dev mailing list, it appears that O_LARGEFILE might be needed to write large files, but participants in that discussion are using O_RDWR , not O_WRONLY , so I am not sure. O_LARGEFILE should never be used directly by applications. It's to be used internally by the 64-bit-offset-compatible version of open in libc when it makes the syscall to the kernel (Linux, or possibly

Do I need an extern “C” block to include standard C headers?

孤街醉人 提交于 2019-11-27 09:27:11
Do I need an extern "C" {} block to include standard C headers in a C++ program. Only consider standard C headers which do not have counterparts in C++. For example: extern "C" { #include <fcntl.h> #include <unistd.h> } The behavior of <fcntl.h> and <unistd.h> in C++ is not specified by the standard (because they are also not part of the C89 standard). That said, I have never seen a platform where they (a) exist and (b) actually need to be wrapped in an extern "C" block. The behavior of <stdio.h> , <math.h> , and the other standard C headers is specified by section D.5 of the C++03 standard.

Where does Microsoft Windows' 7 POSIX implementation currently stand?

风格不统一 提交于 2019-11-27 02:04:29
Is there a full POSIX implementation available in/for Windows 7 (I'm thinking of Windows Services for UNIX)? Is it available in every version of the OS (it seems not)? How does it add/improve or break on previous MS Windows POSIX implementations? Where can i find more info on specific Microsoft approaches and implementations regarding POSIX compliance in Windows 7? Tedd Hansen SUA, formerly called INTERIX, is now 100% POSIX compatible. There are a lot of ported apps for it. Even whole Linux distros like Debian have been ported. SUA/Interix comes with Windows 2003R2 and up (including Win7 which

How can I wait for any/all pthreads to complete?

大兔子大兔子 提交于 2019-11-27 00:52:42
问题 I just want my main thread to wait for any and all my (p)threads to complete before exiting. The threads come and go a lot for different reasons, and I really don't want to keep track of all of them - I just want to know when they're all gone. wait() does this for child processes, returning ECHILD when there are no children left, however wait does not (appear to work with) (p)threads. I really don't want to go through the trouble of keeping a list of every single outstanding thread (as they

Where does Microsoft Windows&#39; 7 POSIX implementation currently stand?

点点圈 提交于 2019-11-26 09:53:51
问题 Is there a full POSIX implementation available in/for Windows 7 (I\'m thinking of Windows Services for UNIX)? Is it available in every version of the OS (it seems not)? How does it add/improve or break on previous MS Windows POSIX implementations? Where can i find more info on specific Microsoft approaches and implementations regarding POSIX compliance in Windows 7? 回答1: SUA, formerly called INTERIX, is now 100% POSIX compatible. There are a lot of ported apps for it. Even whole Linux distros