本文整理汇总了C++中PROC函数的典型用法代码示例。如果您正苦于以下问题:C++ PROC函数的具体用法?C++ PROC怎么用?C++ PROC使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PROC函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: procfs_doprocdbregs
int
procfs_doprocdbregs(PFS_FILL_ARGS)
{
int error;
struct dbreg r;
struct thread *td2;
#ifdef COMPAT_FREEBSD32
struct dbreg32 r32;
int wrap32 = 0;
#endif
if (uio->uio_offset != 0)
return (0);
PROC_LOCK(p);
KASSERT(p->p_lock > 0, ("proc not held"));
if (p_candebug(td, p) != 0) {
PROC_UNLOCK(p);
return (EPERM);
}
td2 = FIRST_THREAD_IN_PROC(p);
#ifdef COMPAT_FREEBSD32
if (SV_CURPROC_FLAG(SV_ILP32)) {
if (SV_PROC_FLAG(td2->td_proc, SV_ILP32) == 0) {
PROC_UNLOCK(p);
return (EINVAL);
}
wrap32 = 1;
}
#endif
error = PROC(read, dbregs, td2, &r);
if (error == 0) {
PROC_UNLOCK(p);
error = UIOMOVE_FROMBUF(r, uio);
PROC_LOCK(p);
}
if (error == 0 && uio->uio_rw == UIO_WRITE) {
if (!P_SHOULDSTOP(p)) /* XXXKSE should be P_TRACED? */
error = EBUSY;
else
/* XXXKSE: */
error = PROC(write, dbregs, td2, &r);
}
PROC_UNLOCK(p);
return (error);
}
示例2: xdr_to_generic_payload
ssize_t
xdr_to_generic_payload(struct iovec inmsg, void *args, xdrproc_t proc,
struct iovec *pendingpayload)
{
XDR xdr;
ssize_t ret = -1;
if ((!inmsg.iov_base) || (!args) || (!proc))
return -1;
xdrmem_create(&xdr, inmsg.iov_base, (unsigned int)inmsg.iov_len,
XDR_DECODE);
if (!PROC(&xdr, args)) {
ret = -1;
goto ret;
}
ret = xdr_decoded_length(xdr);
if (pendingpayload) {
pendingpayload->iov_base = xdr_decoded_remaining_addr(xdr);
pendingpayload->iov_len = xdr_decoded_remaining_len(xdr);
}
ret:
return ret;
}
示例3: AreLegacyFunctionsSupported
static
BOOLEAN
AreLegacyFunctionsSupported(VOID)
{
int Error;
if (!PROC(WSACancelBlockingCall) || !PROC(WSAGetLastError))
return FALSE;
Error = pWSACancelBlockingCall();
ok(Error == SOCKET_ERROR, "Error = %d\n", Error);
ok(pWSAGetLastError() == WSAEOPNOTSUPP ||
pWSAGetLastError() == WSAEINVAL, "WSAGetLastError = %d\n", pWSAGetLastError());
return pWSAGetLastError() != WSAEOPNOTSUPP;
}
示例4: FtpGetFile
BOOL FtpGetFile(Connection *Connect,LPCSTR lpszRemoteFile,LPCSTR lpszNewFile,BOOL Reget,int AsciiMode)
{
PROC(("FtpGetFile","[%s]->[%s] %s %s",lpszRemoteFile,lpszNewFile,Reget?"REGET":"NEW",AsciiMode?"ASCII":"BIN"));
String Command,
full_name;
int ExitCode;
Assert(Connect && "FtpGetFile");
//mode
if(AsciiMode && !Connect->ProcessCommand("ascii"))
{
Log(("!ascii ascii:%d",AsciiMode));
return FALSE;
}
else if(!AsciiMode && !Connect->ProcessCommand("bin"))
{
Log(("!bin ascii:%d",AsciiMode));
return FALSE;
}
//Create directory
Command = lpszNewFile;
int m = Command.RChr('/');
if(m != -1)
{
Command.SetLength(m);
if(!DoCreateDirectory(Command.c_str()))
{
Log(("!CreateDirectory [%s]",Command.c_str()));
return FALSE;
}
}
//Remote file
if(Connect->Host.ServerType!=FTP_TYPE_MVS && *lpszRemoteFile != '/')
{
full_name = Connect->CurDir; //Connect->ToOEMDup(Connect->CurDir.c_str());
AddEndSlash(full_name, '/');
full_name.Add(lpszRemoteFile);
lpszRemoteFile = full_name.c_str();
}
//Get file
Connect->IOCallback = TRUE;
if(Reget && !Connect->ResumeSupport)
{
Connect->AddCmdLine(FMSG(MResumeRestart));
Reget = FALSE;
}
Command.printf("%s \x1%s\x1 \x1%s\x1",
Reget ? "reget":"get",
lpszRemoteFile, lpszNewFile);
ExitCode = Connect->ProcessCommand(Command);
Connect->IOCallback = FALSE;
return ExitCode;
}
示例5: ALLOC
object *primitive_procedure(primitive_proc proc)
{
object *p = ALLOC(object);
TYPE(p) = OBJ_PRIMITIVE_PROCEDURE;
PROC(p) = proc;
return p;
}
示例6: PROC
void Connection::site(int argc, char *argv[])
{
PROC(("site","%d [%s,%s,%s]",argc,(argc>=1)?argv[0]:"nil",(argc>=2)?argv[1]:"nil",(argc>=3)?argv[2]:"nil"));
int i;
char buf[BUFSIZ];
if(argc < 2)
{
code = -1;
return;
}
strcpy(buf, Opt.cmdSite);
strcat(buf, " ");
strcat(buf, argv[1]);
for(i = 2; i < argc; i++)
{
strcat(buf, " ");
strcat(buf, argv[i]);
}
if(command(buf) == RPL_PRELIM)
while(getreply(0) == RPL_PRELIM);
}
示例7: PROC
//---------------------------------------------------------------------------------
void FTP::SaveUsedDirNFile(void)
{
PROC(("SaveUsedDirNFile","was:(%s,%s)",Host.Home,SelectFile.c_str()))
PanelInfo pi;
//Save current file to restore
if(!ShowHosts && hConnect)
{
String s;
FtpGetCurrentDirectory(hConnect,s);
StrCpy(Host.Home, s.c_str(), ARRAYSIZE(Host.Home));
}
//Save current file to restore
if(FP_Info->Control(this,FCTL_GETPANELINFO,&pi))
{
if(pi.ItemsNumber > 0 && pi.CurrentItem < pi.ItemsNumber)
{
SelectFile = FTP_FILENAME(&pi.PanelItems[pi.CurrentItem]);
Log(("SetLastHost: [%s]", SelectFile.c_str()));
}
Log(("Saved (%s,%s)",Host.Home,SelectFile.c_str()));
}
}
示例8: xdr_to_generic
ssize_t
xdr_to_generic(struct iovec inmsg, void *args, xdrproc_t proc)
{
XDR xdr;
ssize_t ret = -1;
if ((!inmsg.iov_base) || (!args) || (!proc))
return -1;
xdrmem_create(&xdr, inmsg.iov_base, (unsigned int)inmsg.iov_len,
XDR_DECODE);
if (!PROC(&xdr, args)) {
ret = -1;
goto ret;
}
ret = xdr_decoded_length(xdr);
ret:
return ret;
}
示例9: xdr_serialize_generic
ssize_t
xdr_serialize_generic(struct iovec outmsg, void *res, xdrproc_t proc)
{
ssize_t ret = -1;
XDR xdr;
if ((!outmsg.iov_base) || (!res) || (!proc))
return -1;
xdrmem_create(&xdr, outmsg.iov_base, (unsigned int)outmsg.iov_len,
XDR_ENCODE);
if (!PROC(&xdr, res)) {
ret = -1;
goto ret;
}
ret = xdr_encoded_length(xdr);
ret:
return ret;
}