📄 classmount.c
字号:
/* $Id: classmount.C,v 1.2 2001/09/19 04:36:18 dm Exp $ *//* * * Copyright (C) 2001 David Mazieres (dm@uun.org) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * */#include "classfscli.h"#include "classfs_prot.h"static ptr<axprt_unix> cfsx;static ptr<aclnt> cfsc;static voidcfsdeof (){ fatal << "EOF from classfsd\n";}static voidclassmount_1 (ref<int> resp, cbi cb, clnt_stat stat){ if (stat) warn << "classfsd: " << stat << "\n"; (*cb) (*resp);}voidclassmount (int fd, const rpc_bytes<64> &fh, str name, cbi cb){ if (!cfsc) { cfsx = axprt_unix::alloc (suidgetfd_required ("classfs")); cfsc = aclnt::alloc (cfsx, classfs_prog_1); cfsc->seteofcb (wrap (cfsdeof)); } classfs_mount_arg arg; if (name.len () > arg.name.maxsize) { (*cb) (ENAMETOOLONG); return; } arg.name = name; arg.fh = fh; ref<int> resp (New refcounted<int>); cfsx->sendfd (fd, false); cfsc->call (CLASSFSPROC_MOUNT, &arg, resp, wrap (classmount_1, resp, cb));}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -