?
Solved

What Library do I use for setfsuid()

Posted on 2000-04-11
10
Medium Priority
?
345 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
  • 4
  • 4
  • 2
10 Comments
 
LVL 2

Accepted Solution

by:
modulus earned 300 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month13 days, 19 hours left to enroll

807 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