// ftok(3): // key_t ftok(const char *pathname, int proj_id); func ftok(path string, projId int) (int, error) { cs := C.CString(path) if cs == nil { return 0, errors.New(MemoryAllocationError) } defer C.free(unsafe.Pointer(cs)) res, err := C.ftok(cs, C.int(projId)) if err != nil { return -1, err } return int(res), nil }
func ftok(path string, id int) int { return int(C.ftok(C.CString(path), C.int(id))) }