Hi Frederik,

On Tue, Nov 25, 2008 at 5:49 AM, Frederik Schwarzer
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> I looked a bit further into my problem and think I am only confused.
> "Not working" meant that I receive a "implicitly decleared" compile error.
> (No support board, so keeping the rest of it out of here...)


I think you need to look more closely at the man-page then.  It says:

SYNOPSIS
       #include <unistd.h>

       int gethostname(char *name, size_t len);
       int sethostname(const char *name, size_t len);

   Feature    Test    Macro    Requirements    for    glibc   (see   fea-
   ture_test_macros(7)):

       gethostname(): _BSD_SOURCE || _XOPEN_SOURCE >= 500
       sethostname(): _BSD_SOURCE || (_XOPEN_SOURCE &&
       _XOPEN_SOURCE < 500)

So, it may be that you are not defining the required FTM.  Have a read
of feature_test_macros(7).

Cheers,

Michael

PS I am not part of Debian.  If you feel your bug report was in erroir
(I think it is), then would you please close the bug.


> Due to the extern, I thought the function might have been moved somewhere 
> else.
> Now I saw that getenv() and setenv() are externs in stdlib.h as well and for 
> me
> getenv() works but setenv() doesn't.
>
> Thus I think it's more a user problem.
> So if you get gethostname() working by including unistd.h, feel free
> to close. :)
> Until I didn't find out what's going on, I do not want to do it
> because I have no clue
> if it the right thing to do.
>
> Regards
>
>
>
>



-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
git://git.kernel.org/pub/scm/docs/man-pages/man-pages.git
man-pages online: http://www.kernel.org/doc/man-pages/online_pages.html
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to