Re: Help porting UNIX Socket Based App
From: Joseph M. Newcomer (newcomer_at_flounder.com)
Date: 02/23/05
- Next message: bicoman: "RE: Serial Port won't read"
- Previous message: Nobody: "Re: problem getting TRUE height of text???"
- In reply to: Jim Jones: "Help porting UNIX Socket Based App"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 23 Feb 2005 12:03:51 -0500
I think the question is, what is meant by "AF_UNIX_SOCK_STREAM" and "AF_UNIX"? Can you say
what these actually do, and why they are different from AF_INET and AF_SOCK_STREAM, on
Unix? Without knowing what these were intended to mean, it is hard to guess how to convert
them.
joe
On Wed, 23 Feb 2005 07:30:06 -0600, "Jim Jones"
<jim@pleaseremovethisalongwithdash-qtextender.com> wrote:
>What is your suggested changes in order to port the following code segment
>to the Windows platform? AF_UNIX? I don't understand these definitions.
>
>int
>gaim_remote_session_connect(int session)
>{
> gint fd;
> uid_t stored_uid, euid;
> struct sockaddr_un saddr;
>
> if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) != -1)
> {
> saddr.sun_family = AF_UNIX;
> stored_uid = getuid();
> euid = geteuid();
> setuid(euid);
> sprintf(saddr.sun_path, "%s/gaim_%s.%d",
> g_get_tmp_dir(), g_get_user_name(), session);
> setreuid(stored_uid, euid);
>
> if (connect(fd, (struct sockaddr *) &saddr, sizeof (saddr)) != -1)
> return fd;
> }
>
> close(fd);
>
> return -1;
>}
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
- Next message: bicoman: "RE: Serial Port won't read"
- Previous message: Nobody: "Re: problem getting TRUE height of text???"
- In reply to: Jim Jones: "Help porting UNIX Socket Based App"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|