The Posix.SysDB 구조

The Posix.SysDB 구조

시스템(사용자, 그룹) 데이터베이스 조회 인터페이스를 제공하는 구조예요.

출처: 문서

본문

시놉시스 (Synopsis)

signature POSIX_SYS_DB
structure SysDB : POSIX_SYS_DB

인터페이스 (Interface)

eqtype uid
eqtype gid
structure Passwd : sig
type passwd
val name : passwd -> string
val uid : passwd -> uid
val gid : passwd -> gid
val home : passwd -> string
val shell : passwd -> string
end
structure Group : sig
type group
val name : group -> string
val gid : group -> gid
val members : group -> string list
end
val getgrgid : gid -> Group.group
val getgrnam : string -> Group.group
val getpwuid : uid -> Passwd.passwd
val getpwnam : string -> Passwd.passwd

설명 (Description)

eqtype uid

사용자 데이터베이스 엔트리 조회 함수를 담아요.

eqtype gid

그룹 데이터베이스 엔트리 조회 함수를 담아요.

structure Passwd

type passwd

사용자에 관한 정보예요.

val name : passwd -> string
val uid : passwd -> uid
val gid : passwd -> gid
val home : passwd -> string
val shell : passwd -> string

이 함수들은 passwd 값에 해당하는 사용자의 이름, 사용자 ID, 그룹 ID, 초기 작업(홈) 디렉터리 경로, 초기 명령 셸을 각각 추출해요. C의 해당 필드 이름도 같지만 "pw_" 접두사가 붙어 있어요. 단 한 가지 예외는 홈 디렉터리에 C에서 pw_dir을 쓴다는 점이에요.

structure Group

type group

그룹에 관한 정보예요.

val name : group -> string
val gid : group -> gid
val members : group -> string list

이 함수들은 group 값에 해당하는 그룹의 이름, 그룹 ID, 그룹에 속한 사용자들의 이름을 각각 추출해요. C에서 이 필드들은 각각 gr_name, gr_gid, gr_mem으로 불려요.

val getgrgid : gid -> Group.group
val getgrnam : string -> Group.group
val getpwuid : uid -> Passwd.passwd
val getpwnam : string -> Passwd.passwd

이 함수들은 주어진 그룹 ID나 이름, 또는 사용자 ID나 이름에 해당하는 그룹 또는 사용자 데이터베이스 엔트리를 돌려줘요. 주어진 ID나 이름에 해당하는 그룹이나 사용자가 없으면 OS.SysErr를 발생시켜요.

더 알아보기 (Learn more)

  • [ Top | Parent | Contents | Index | Root ] Generated April 12
  • 2004 Last Modified July 1
  • 2002 Comments to John Reppy. This document may be distributed freely over the internet as long as the copyright notice and license terms below are prominently displayed within every machine-readable copy. Copyright © 2004 AT&T and Lucent Technologies. All rights reserved. Permission is granted for internet users to make one paper copy for their own personal use. Further hardcopy reproduction is strictly prohibited. Permission to distribute the HTML document electronically on any medium other than the internet must be requested from the copyright holders by contacting the editors. Printed versions of the SML Basis Manual are available from Cambridge University Press. To order
  • please visit www.cup.org (North America) or www.cup.cam.ac.uk (outside North America).