示例#1
0
文件: devfs.c 项目: anandab/akaros
/* TODO: consider making this only deal with the inode */
struct file *make_device(char *path, int mode, int type,
                         struct file_operations *fop)
{
	struct file *f_dev = do_file_open(path, O_CREAT | O_RDWR, mode);
	assert(f_dev);
	/* Overwrite the f_op with our own f_ops */
	f_dev->f_dentry->d_inode->i_fop = fop;
	f_dev->f_op = fop;
	SET_FTYPE(f_dev->f_dentry->d_inode->i_mode, type);
	return f_dev;
}
示例#2
0
文件: mono.c 项目: kmizumar/Mono
void bindfunc(char *name, ftype ftype, int func){
        int addr;

        addr = freshcell();
        SET_NAME(addr,name);
        SET_TAG(addr,FUN);
    SET_FTYPE(addr,ftype);
    switch(ftype){
        case SUBR:
        case FSUBR:             SET_SUBR(addr,func);
        case LAMBDA:    SET_BIND(addr,func);
    }
    SET_CDR(addr,E);
    E = addr;
}