Solved

What Library do I use for setfsuid()

Posted on 2000-04-11
10
337 Views
Last Modified: 2008-02-20
I keep getting the warning "implicit declaration of function setfsuid()". It has been my experience that I am missing either a #include or #define statement at the beginning of my program. The man pages don't say what to use. Do you have any ideas?
0
Comment
Question by:joleen2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
10 Comments
 
LVL 2

Accepted Solution

by:
modulus earned 100 total points
ID: 2705000
Description of function:
man 2 setfsuid
Include file:
/usr/include/sys/fsuid.h

Best wishes,
modulus
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2705005
All that means is that the compiler doesn't know the return type for the function. The doc's don't indicate that a header file is needed, not surprising as it returns an int, and takes as and arg a uid_t... Nothing fancy here and the compiler knows the types.

If it bothers you, include an "int setfsuid();" declaration.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2705018
modulus,

Which linux? On RH 6.1 man 2 setfsuid doesn't reference the include file (tho I agree it's there).
0
The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

 

Author Comment

by:joleen2
ID: 2705260
RH 5.0. I like a clean build.
0
 
LVL 2

Expert Comment

by:modulus
ID: 2709381
Hi jlevie,
I use a mixture of info, man, grep and etags (built for all libc) and emacs (C-h C-i) to find out what things are.  I found it I think from using the tags for the library.  I'm not sure whether it's better to declare the function as you suggest or to use a previously existing one.  I'd tend toward the latter though.  No, I don't have a nice version of the man pages!  I'm using RH6.1 at present too.
Best wishes,
modulus
0
 

Author Comment

by:joleen2
ID: 2709446
I tried writing a prototype, no go. I tried declaring in after the call, no go. I get an error of either, "to many arguments" or "undefined reference." I am at a loss.
0
 

Author Comment

by:joleen2
ID: 2709472
Modulus,
Thank you. I am new to this site and am fiquring it out. I finally saw your note to use #include/sys/fsuid. It worked. How or where did you locate this info? I have been trying to find this out for 2 months.  Many thanks Joleen
0
 
LVL 2

Expert Comment

by:modulus
ID: 2709552
joleen2,
hello again.  Supposedly you should be able to find out all that you need to know from the man pages.  Don't believe it!  Although they are fine documents and a lot of people have given their time to create this resource it tends to be a bit patchy. Also man pages are deprecated by the FSF and consequently a lot of the documentation is better if you use "info".  Info can be a bit awkward at first, but once you get used to it there's a lot there, especially if you examine the libc entry and especially if you use emacs.  In emacs you can just position the cursor on a function or macro and type C-h C-i and it'll go search for the libc entry.
      Then there are tags - tables of definitions that you can create using etags (for emacs and ctags I think for vi?) which when in emacs you type Meta-. brings you to the actual definition.
      Then there's using grep.  If you are aware of the locations of the c library on your system then you can very profitably type:
grep -e "setfsuid" /usr/include/sys/*
and see what turns up.  The File System Hierarchy specifications are a great help in this if your system adheres to them.
Hope that helps.  If there's any more you want to know, don't hesitate to ask.
Best wishes,
Modulus
0
 

Author Comment

by:joleen2
ID: 2709578
Thank you that is great information. Just one other question about this site. How did you know I emailed you? Does the fact that I write a message in the comments section when I am responding to a response to my question send you an email too?
0
 
LVL 2

Expert Comment

by:modulus
ID: 2709604
When you comment on the site then an email is sent automatically to those that enable this option.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question