diff --git a/lib/libc/gen/ftok.3 b/lib/libc/gen/ftok.3 index 2139a3280107..9b135ef4a17b 100644 --- a/lib/libc/gen/ftok.3 +++ b/lib/libc/gen/ftok.3 @@ -1,4 +1,4 @@ -.\" $NetBSD: ftok.3,v 1.3 1998/02/05 18:46:21 perry Exp $ +.\" $NetBSD: ftok.3,v 1.4 1998/11/12 16:15:17 christos Exp $ .\" .\" Copyright (c) 1994 SigmaSoft, Th. Lockert .\" All rights reserved. @@ -37,7 +37,7 @@ .Fd #include .Fd #include .Ft key_t -.Fn ftok "const char *path" "char id" ; +.Fn ftok "const char *path" "int id" ; .Sh DESCRIPTION The .Fn ftok @@ -57,10 +57,14 @@ must specify an existing file that is accessible to the calling process or the call will fail. Also, note that links to files will return the same key, given the same .Fa id . +.Pp +Only the 8 least significant bits of +.Fa id +are used in the key generation; the rest of the bits are ignored. .Sh RETURN VALUES The .Fn ftok -function will return -1 if +function will return ((ket_t)-1) if .Fa path does not exist or if it cannot be accessed by the calling process. .Sh SEE ALSO diff --git a/lib/libc/gen/ftok.c b/lib/libc/gen/ftok.c index 32c03124eab6..80777f173f2a 100644 --- a/lib/libc/gen/ftok.c +++ b/lib/libc/gen/ftok.c @@ -1,4 +1,4 @@ -/* $NetBSD: ftok.c,v 1.5 1997/07/21 14:07:00 jtc Exp $ */ +/* $NetBSD: ftok.c,v 1.6 1998/11/12 16:15:17 christos Exp $ */ /* * Copyright (c) 1994 SigmaSoft, Th. Lockert @@ -29,7 +29,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: ftok.c,v 1.5 1997/07/21 14:07:00 jtc Exp $"); +__RCSID("$NetBSD: ftok.c,v 1.6 1998/11/12 16:15:17 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -44,7 +44,7 @@ __weak_alias(ftok,_ftok); key_t ftok(path, id) const char *path; - char id; + int id; { struct stat st;