Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
bef9f6d6
Commit
bef9f6d6
authored
11 years ago
by
Steven Murray
Committed by
Steven Murray
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Improved the comments surrounding strerror_r_wrapper()
parent
865a4e4c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mediachanger/castorrmc/common/strerror_r_wrapper.cpp
+10
-0
10 additions, 0 deletions
mediachanger/castorrmc/common/strerror_r_wrapper.cpp
mediachanger/castorrmc/h/strerror_r_wrapper.h
+10
-0
10 additions, 0 deletions
mediachanger/castorrmc/h/strerror_r_wrapper.h
with
20 additions
and
0 deletions
mediachanger/castorrmc/common/strerror_r_wrapper.cpp
+
10
−
0
View file @
bef9f6d6
...
...
@@ -39,5 +39,15 @@
* strerror_r_wrapper
******************************************************************************/
extern
"C"
int
strerror_r_wrapper
(
int
errnum
,
char
*
buf
,
size_t
buflen
)
{
/* This function should be compiled using a C++ compiler and not a C compiler.
*
* C++ compilers are better at spotting whether the GNU version or the
* XSI complicant version of sterror_() is being used. This is because the
* difference between the two versions is their return types. The GNU
* version returns a 'char *' whereas the XSI compliant version returns an
* 'int'. A C compiler may allow the strerror_r() function to return a
* 'char *' and have that 'char *' assigned to an 'int'. A C++ compiler
* usually gives an error if this is tried.
*/
return
strerror_r
(
errnum
,
buf
,
buflen
);
}
This diff is collapsed.
Click to expand it.
mediachanger/castorrmc/h/strerror_r_wrapper.h
+
10
−
0
View file @
bef9f6d6
...
...
@@ -44,6 +44,16 @@
* This function wraps the XSI compliant version of strerror_r() and therefore
* writes the string representation of the specified error number to the
* specified buffer.
*
* This function should be compiled using a C++ compiler and not a C compiler.
*
* C++ compilers are better at spotting whether the GNU version or the
* XSI complicant version of sterror_() is being used. This is because the
* difference between the two versions is their return types. The GNU
* version returns a 'char *' whereas the XSI compliant version returns an
* 'int'. A C compiler may allow the strerror_r() function to return a
* 'char *' and have that 'char *' assigned to an 'int'. A C++ compiler
* usually gives an error if this is tried.
*
* @param errnum The error number.
* @param buf The buffer.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment