userenv.h

来自「AMLOGIC DPF source code」· C头文件 代码 · 共 102 行

H
102
字号
/*******************************************************************
 * 
 *  Copyright C 2005 by Amlogic, Inc. All Rights Reserved.
 *
 *  Description: 
 *
 *  Author: Amlogic Software
 *  Created: Fri Nov 11 01:05:58 2005
 *
 *******************************************************************/
/*
 *  Libio Internal Information
 *
 *  COPYRIGHT (c) 1989-1999.
 *  On-Line Applications Research Corporation (OAR).
 *
 *  The license and distribution terms for this file may be
 *  found in the file LICENSE in this distribution or at
 *  http://www.avfs.com/license/LICENSE.
 *
 *  userenv.h,v 1.2.2.1 2003/09/04 18:55:05 joel Exp
 */

#ifndef __avfs_userenv_h
#define __avfs_userenv_h
#if 0
//porting
#include <avfs.h>
#include <avfs/fs.h>
#else
//#include "avfs.h"
#include "fs.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif

/*
 *  External structures
 */

/*
 * According to IEEE Std 1003.1-2001, 
 * limits.h is supposed to provide _POSIX_LOGIN_NAME_MAX
 * FIXME: We should not rely on this.
 */
// porting
//#include <limits.h>

#ifdef _POSIX_LOGIN_NAME_MAX
#define LOGIN_NAME_MAX _POSIX_LOGIN_NAME_MAX
#else
/* Fallback */
#define LOGIN_NAME_MAX 9
#endif

typedef struct {
 avfs_id                         task_id;	
 avfs_filesystem_location_info_t current_directory;
 avfs_filesystem_location_info_t root_directory;
 /* Default mode for all files. */
 mode_t                           umask;
 nlink_t                          link_counts;
 /* _POSIX_types */
 uid_t                            uid;
 gid_t                            gid;
 uid_t                            euid;
 gid_t                            egid;
 char      login_buffer[LOGIN_NAME_MAX];

 pid_t                            pgrp; /* process group id */
} avfs_user_env_t;

extern avfs_user_env_t * avfs_current_user_env; 
extern avfs_user_env_t   avfs_global_user_env; 

#define avfs_filesystem_current     (avfs_current_user_env->current_directory)
#define avfs_filesystem_root        (avfs_current_user_env->root_directory)
#define avfs_filesystem_link_counts (avfs_current_user_env->link_counts)
#define avfs_filesystem_umask       (avfs_current_user_env->umask)

#define _POSIX_types_Uid             (avfs_current_user_env->uid)
#define _POSIX_types_Gid             (avfs_current_user_env->gid)
#define _POSIX_types_Euid            (avfs_current_user_env->euid)
#define _POSIX_types_Egid            (avfs_current_user_env->egid)
#define _POSIX_types_Getlogin_buffer (avfs_current_user_env->login_buffer)


/*
 *  Instantiate a private copy of the per user information for the calling task.
 */

avfs_status_code avfs_libio_set_private_env(void);
avfs_status_code avfs_libio_share_private_env(avfs_id task_id) ;
	
#ifdef __cplusplus
}
#endif

#endif
/* end of include file */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?