Opened 6 years ago

Closed 3 months ago

#10841 closed bug (no change required)

gethostid() is missing

Reported by: korli Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: System/POSIX Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All


Change History (2)

comment:1 by luroh, 6 years ago

Milestone: R1Unscheduled

Move POSIX compatibility related tickets out of R1 milestone (FutureHaiku/Features).

comment:2 by pulkomandy, 3 months ago

Resolution: no change required
Status: newclosed

After discussion in , we have decided that this function is useless and it is better to not implement it at all.

For reference:

  • The implementation in glibc attempts to compute an hostid based on the local IP, but on Debian it computes it based on instead so all machines have the same host id.
  • musl just returns 0
  • NetBSD, FreeBSD and OpenBSD implements it but mentions that is deprecated and that it had been removed in 4.4BSD

Alternative mechanisms (sysctl, file in /etc, dbus or systemd functions, ...) are available to identify the machine with a larger id (typically an UUID or similar).

I suggest we open a ticket against POSIX so that they remove it from the spec (apparently no one has bothered to do that yet).

Note: See TracTickets for help on using tickets.