TEMP_FAILURE_RETRY and __USE_GNU
source link: https://www.codesd.com/item/temp-failure-retry-and-use-gnu.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
TEMP_FAILURE_RETRY and __USE_GNU
I'm on Ubuntu 10.04 using GCC and I want to use the macro TEMP_FAILURE_RETRY as described here:
http://www.gnu.org/s/hello/manual/libc/Interrupted-Primitives.html
However, when I compile I got the following error:
undefined reference to `TEMP_FAILURE_RETRY'
I looked in unistd.h where the macro is defined and it is preceded by:
#ifdef __USE_GNU
How do I get my code to compile and use this macro? Can I simply wrap it using the same #ifdef __USE_GNU in my code?
__USE_GNU
is an internal macro, so you shouldn't define it yourself.
But you may define _GNU_SOURCE
, either in your code, or when compiling (using the -D
option).
I think defining this one will help to make TEMP_FAILURE_RETRY
available.
Related Articles
_GNU_SOURCE and __USE_GNU
A strange disconnect between Eclipse CDT, the included system headers, and the underlying construction C
Gradle Exec Task and Exit Process
Problem with code to read multiple looped files to read and special lines to import
How to analyze and interpret ant build.xml
Windows Sharepoint Services and SQL Server Express
How to make iterate via text and replace some words with a dictionary value
What tools are needed to scratch, click, and analyze data from a website
How to apply regex to a web page for a text string URL and a previous line of text before that?
Firebase Swift - How to create a child and add its identifier to another reference property?
Determine the minimum value in the table and find the corresponding string in another table
How to send and retrieve parameters using $ state.go toParams and $ stateParams?
Reading and partially writing files with iOS SDK
The fluid and dynamic animation on the object appears and disappears (HTML / JS / CSS)
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK