a question about socket-syscall, thinks
From: Jon (comepu_at_gmail.com)
Date: 11/25/05
- Previous message: Bruce A. Mah: "Re: Is fetch -6 supposed to work?"
- Next in thread: Robert Watson: "Re: a question about socket-syscall, thinks"
- Reply: Robert Watson: "Re: a question about socket-syscall, thinks"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: <freebsd-net@freebsd.org> Date: Fri, 25 Nov 2005 16:35:39 +0800
NET_LOCK_GIANT();
error = socreate(uap->domain, &so, uap->type, uap->protocol,
td->td_ucred, td);
NET_UNLOCK_GIANT();
if (error) {
fdclose(fdp, fp, fd, td);
} else {
FILEDESC_LOCK_FAST(fdp);
fp->f_data = so; /* already has ref count */
fp->f_flag = FREAD|FWRITE;
fp->f_ops = &socketops;
fp->f_type = DTYPE_SOCKET;
FILEDESC_UNLOCK_FAST(fdp);
td->td_retval[0] = fd;
}
fdrop(fp, td);
return (error);
I found these lines in "kern/uipc_syscalls.c(166-182, version:5.4)". I had a question! Why drop "fp" if socreate function return success? Can you tell me? Thank you very much!
Joe
_______________________________________________
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
- Previous message: Bruce A. Mah: "Re: Is fetch -6 supposed to work?"
- Next in thread: Robert Watson: "Re: a question about socket-syscall, thinks"
- Reply: Robert Watson: "Re: a question about socket-syscall, thinks"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]