Solved

What Library do I use for setfsuid()

Posted on 2000-04-11
10
326 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
 

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

705 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

20 Experts available now in Live!

Get 1:1 Help Now