Solved

What Library do I use for setfsuid()

Posted on 2000-04-11
10
330 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 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 Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

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

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
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…
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.

813 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now