3

TEMP_FAILURE_RETRY and __USE_GNU

 2 years ago
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.
neoserver,ios ssh client

TEMP_FAILURE_RETRY and __USE_GNU

advertisements

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

I want to use CPU_SET, which is a glibc linux-specific macro that should be defined in sched.h The manpage clearly states that _GNU_SOURCE must be defined so that the macro is defined. However, looking at the header, CPU_SET is defined only if __USE_

A strange disconnect between Eclipse CDT, the included system headers, and the underlying construction C

I'm having a strange problem with include files and an apparent disconnect between Eclipse's build process and its error reporting. I'll give detailed steps to reproducing this problem, so we can narrow the causes down as quickly as possible. Eclipse

Gradle Exec Task and Exit Process

I have a python script which prints some strings and updates it's execution progress in console: if __name__ == '__main__': ... print 'Hello, world!' while page <= pages: ... done = float(page) / pages sys.stdout.write('\r[{0:50s}] {1:.2f}%'.format('

Problem with code to read multiple looped files to read and special lines to import

I am really desperate to have your help to get this code fixed before end of today because my boss wants it to be done. I could not figure out how to set loop to read multiple files in .txt then import special lines to excel!! Please help me. Sub Imp

How to analyze and interpret ant build.xml

Is there an Ant API for reading and ant build.xml and retrieving elements from it? Specifically I want to be able to retrieve the values in a path element and be able to walk all of the elements in the path. My purpose is to retrieve a given path and

Windows Sharepoint Services and SQL Server Express

Can I use sql express to run WSS on windows server 2008 and if I can would this be a wise move?Have a read of this article. You can use Windows Internal Database that's built into Windows 2008 as your database server. The primary limitation is that S

How to make iterate via text and replace some words with a dictionary value

This question already has an answer here: Python replace function [replace once] 6 answers I want to create something that searches through a sentence and takes whatever words you want out and switches them with a replacement. Here's what I have so f

What tools are needed to scratch, click, and analyze data from a website

Ok so I just want to know what my best plan of action is here and what tools/frameworks would I need: 1. Log onto webpage 2. Navigate to desired page which would require clicking on buttons and then filling in text boxes for searching 3-4 On loop 3.

How to apply regex to a web page for a text string URL and a previous line of text before that?

Hi guys thanks for pay attention to this. Well im trying to replace every full youtube url with a word. An Example: http://www.youtube.com/watch?v=lDC0gdrcauI Should be replaced with the word "Video" http://www.youtube.com/watch?v=ef0wk8QoA34&am

Firebase Swift - How to create a child and add its identifier to another reference property?

As described here, I'd like to store Book objects in a separate ref and store its id value inside books property of User Users: user_id:121jhg12h12 email: "[email protected]" name: "John Doe" profile_pic_path: "https://...". langu

Determine the minimum value in the table and find the corresponding string in another table

I have a 'winners screen' in a mini-golf scorecard app I'm making. I have two arrays that store 1). The player's names and 2). Their scores. playerNameArray = [[NSMutableArray alloc]initWithObjects:playerOneName.text, playerTwoName.text, playerThreeN

How to send and retrieve parameters using $ state.go toParams and $ stateParams?

I am using AngularJS v1.2.0-rc.2 with ui-router v0.2.0. I want to pass the referrer state to another state so I use the toParams of $state.go like so: $state.go('toState', {referer: $state.current.name}); According to the docs, this should populate t

Reading and partially writing files with iOS SDK

I want to get the first 8 bytes or so of a file without reading the whole file. I'm using NSData to operate on the data and such, but I don't want to slow down my application with excessive file reads and writes because in some cases I'm having to re

The fluid and dynamic animation on the object appears and disappears (HTML / JS / CSS)

it's difficult to describe in the title,but what I'm thinking of are those sites like some of the Tumblrs or some other fancy webpages where the parts (for example the images) when they appear they move in next to the existing ones, you can move them

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK