hns - 日記自動生成システム - Version 2.19.9

先月 2015年10月 来月
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Namazu for hns による簡易全文検索
詳しくは 詳細指定/ヘルプを参照して下さい
検索式:

2015年10月23日(金) 旧暦 [n年日記] [更新:"2015/10/23 15:28:44"]

#1 [pkgsrc] open-vm-tools implicit declaration of 'gethostbyname_r'

gethostbyname_r がないと言われて
/export/WRKOBJDIR/wip-git/open-vm-tools/work/
open-vm-tools-9.4.0-1280544/lib/include/posix.h:215:4: 
error: implicit declaration of function 'gethostbyname_r' 
前にも一度見たことがあるなと思ったが、同じところだった。 2014/03/27

FreeBSD の場合:

FreeBSD はどうしているのかなと思ったら、
/usr/src/lib/libc/net/gethostnamadr.c の中に定義してあって、しかもこれは内部関数で、
    491 int
    492 gethostbyname_r(const char *name, struct hostent *he, char *buffer,
    493     size_t buflen, struct hostent **result, int *h_errnop)
    494 {
    495         res_state statp;
    496
    497         statp = __res_state();
    498         if ((statp->options & RES_INIT) == 0 && res_ninit(statp) == -1) {
    499                 RES_SET_H_ERRNO(statp, NETDB_INTERNAL);
    500                 return (-1);
    501         }
    502         if (statp->options & RES_USE_INET6) {
    503                 if (fakeaddr(name, AF_INET, he, buffer, buflen, statp) == 0) {
    504                         *result = he;
    505                         return (0);
    506                 }
    507                 if (gethostbyname_internal(name, AF_INET6, he, buffer, buflen,
    508                     result, h_errnop, statp) == 0)
    509                         return (0);
    510         }
    511         return (gethostbyname_internal(name, AF_INET, he, buffer, buflen,
    512             result, h_errnop, statp));
    513 }
gethostname から呼出していて、gethostname は reentrant 版になっているらしい
    669 struct hostent *
    670 gethostbyname(const char *name)
    671 {
    672         struct hostdata *hd;
    673         struct hostent *rval;
    674         int ret_h_errno;
    675
    676         if ((hd = __hostdata_init()) == NULL)
    677                 return (NULL);
    678         if (gethostbyname_r(name, &hd->host, hd->data, sizeof(hd->data), &rval,
    679             &ret_h_errno) != 0)
    680                 return (NULL);
    681         return (rval);
    682 }
と思ったら、NetBSD も同様の気がする。



最近の日記
2024年03月10日
停電 (瞬電)
2024年03月03日
the second try on bare-metal
useradd
2024年02月29日
opendkim and senmail
2024年01月24日
chat/iam 0.0.8
2024年01月21日
uselocale vs setlocale (textproc/R-readxl)
以上、1 日分です。
タイトル一覧
カテゴリ分類
Powered by hns-2.19.9, HyperNikkiSystem Project

Count.cgi (since 2000/02/05)