473,652 Members | 3,070 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

List of reentrant C/C++ functions

Would anyone please point me to a list of reentrant GNU C/C++ library
functions? I have searched a lot on the web for it but without any
success. Man page of signal(2) has listed system calls (POSIX
1003.1-2003 list) which are safe(reentrant) but thats not sufficient
for my purpose.

Thanks in advance.

Nov 23 '05 #1
2 2839
"TheOne" <su************ ****@gmail.com> wrote in message
news:11******** *************@g 47g2000cwa.goog legroups.com...
: Would anyone please point me to a list of reentrant GNU C/C++ library
: functions? I have searched a lot on the web for it but without any
: success. Man page of signal(2) has listed system calls (POSIX
: 1003.1-2003 list) which are safe(reentrant) but thats not sufficient
: for my purpose.
:
: Thanks in advance.
Regarding the GNU implementation, you should ask on a dedicated
forum (clc++ is dedicated to the standard C++ language).
The C++ standards says nothing about multi-threaded or multi-
process platforms, so it is all platform-specific.

This said, on all major platforms, fully reentrant
implementations of the standard library are available.
This will usually be the case of GNU C/C++ as well,
although single-threaded libs (e.g. for malloc etc)
may also exist on some platforms.

Some standard C functions are known to be incompatible
with a reentrant implementation, because they use
static storage. These include strtok and gmtime, and
some functions altering the 'locale' settings.
Those calls can usually be avoided (or, occasionally,
accessed serially only by locking an associated mutex).
However, this requires using platform-specific techniques.
hth-Ivan
--
http://ivan.vecerina.com/contact/?subject=NG_POST <- email contact form
Brainbench MVP for C++ <> http://www.brainbench.com
Nov 24 '05 #2

Ivan Vecerina wrote:

[]
Some standard C functions are known to be incompatible
with a reentrant implementation, because they use
static storage. These include strtok and gmtime, and
some functions altering the 'locale' settings.
Those calls can usually be avoided (or, occasionally,
accessed serially only by locking an associated mutex).
However, this requires using platform-specific techniques.


More of that, on platforms like Windoze those are not reentrant but
thread-safe since they use TLS for their statics.

Nov 24 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
12834
by: Booser | last post by:
// Merge sort using circular linked list // By Jason Hall <booser108@yahoo.com> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <math.h> //#define debug
6
11038
by: junky_fellow | last post by:
what are reentrant functions? What are the characteristics of a reentrant code ? what things should be kept in mind while writing a reentrant code ?
11
2817
by: Neo | last post by:
Hi Frns, Could U plz. suggest me how can i reverse a link list (without recursion)??? here is my code (incomplete): #include<stdio.h>
57
4269
by: Xarky | last post by:
Hi, I am writing a linked list in the following way. struct list { struct list *next; char *mybuff; };
4
3589
by: MJ | last post by:
Hi I have written a prog for reversing a linked list I have used globle pointer Can any one tell me how I can modify this prog so that I dont have to use extra pointer Head1. When I reverse a LL using the recursive call how to change the last node pointer to head and head->next to null without using the extra global pointer Mayur
9
8289
by: TheOne | last post by:
Would anyone please point me to a list of reentrant C library functions? I want to know which C library functions are safe to use inside a signal handler across all platforms. Does GNU C library make few other functions reentrant on Linux platform? I have searched a lot on the web for it but without any success. Man page of signal(2) has listed system calls (POSIX 1003.1-2003 list) which are safe(reentrant) but thats not sufficient for...
17
3253
by: fmassei | last post by:
Dear all, I'm trying to put some old code in a portable, cross-platform library and I'm facing a big problem: is there a standard, platform- independent way to write a reentrant function that allocate dynamic memory? In other words: is it safe to use malloc() or free() in a thread-safe function? Thank you, Francesco
12
3482
by: Bit Byte | last post by:
I am modifying some legacy code, to make the functions reentrant. I use lots of global data (large nested structs) to pass data around quicky. The global structures are far too large (in size) for each of my functions to maintain copies. Any suggestions on the best way to write a reentrant version of my library? - bearing in mind that my global vars are mostly, pointers to *HUGE* structures.
36
2886
by: pereges | last post by:
Hi, I am wondering which of the two data structures (link list or array) would be better in my situation. I have to create a list of rays for my ray tracing program. the data structure of ray looks like this: typedef struct { vector origin; /* vector is an array of 3 doubles */
0
8367
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8811
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8703
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8589
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7302
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4145
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2703
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1914
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.