* server-start under Windows
@ 2002-11-06 4:45 Ben Key
2002-11-06 9:53 ` Kim F. Storm
0 siblings, 1 reply; 9+ messages in thread
From: Ben Key @ 2002-11-06 4:45 UTC (permalink / raw)
I have managed to get emacsclient to build under Windows. However, I cannot
test it because whenever I call server-start, I get a "Unknown address
family" error message. I spent some time debugging this and I found that it
is being generated by the built in function "make-network-process" in
process.c, line 2749. I am at a loss as to how to resolve this problem. If
someone could help me resolve this issue, I might be able to complete my
Windows port of emacsclient this weekend.
For those of you who are interested in knowing how I got emacsclient to
build under Windows, it was actually pretty easy, but time consuming. All I
really needed to do was copy a bunch of code from w32.c (the socket related
functions such as sys_connect, sys_gethostname and sys_socket and the user
information functions such as getuid, geteuid, and getpwnam) and w32proc.c
(various process related functions such as new_child).
Beyond that, there were only relatively minor changes that were required.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: server-start under Windows
2002-11-06 4:45 server-start under Windows Ben Key
@ 2002-11-06 9:53 ` Kim F. Storm
2002-11-06 15:45 ` Stefan Monnier
0 siblings, 1 reply; 9+ messages in thread
From: Kim F. Storm @ 2002-11-06 9:53 UTC (permalink / raw)
Cc: emacs-devel
"Ben Key" <Bkey1@tampabay.rr.com> writes:
> I have managed to get emacsclient to build under Windows. However, I cannot
> test it because whenever I call server-start, I get a "Unknown address
> family" error message. I spent some time debugging this and I found that it
> is being generated by the built in function "make-network-process" in
> process.c, line 2749. I am at a loss as to how to resolve this problem.
I assume that's because in server.el, make-network-process is called with
these args:
:family 'local :service server-socket-name
This only works if AF_LOCAL (aka. AF_UNIX) is supported by the O/S --
so I would assume it isn't supported on Windoze...
Probably, the solution is to use a local network connection if
:family 'local isn't supported. This can be tested in lisp with
(featurep 'make-network-process '(:family local))
Maybe Stefan can help you here.
--
Kim F. Storm <storm@cua.dk> http://www.cua.dk
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: server-start under Windows
@ 2002-11-06 14:34 bkey1
2002-11-06 15:55 ` Stefan Monnier
0 siblings, 1 reply; 9+ messages in thread
From: bkey1 @ 2002-11-06 14:34 UTC (permalink / raw)
storm@cua.dk wrote:
> Probably, the solution is to use a local network connection if
> :family 'local isn't supported. This can be tested in lisp with
>
> (featurep 'make-network-process '(:family local))
>
> Maybe Stefan can help you here.
Stephan, can you provide any assistance with this issue? If you can give me an
idea what needs to be changed, I would be more than willing to make the change.
Just as a reminder, the issue at hand is that I have managed to port
emacsclient to Windows but I cannot test it because I get the following error
when I call server-start
"Unknown address family"
due to a failure in the built in function "make-network-process" (process.c,
line 2749).
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: server-start under Windows
2002-11-06 9:53 ` Kim F. Storm
@ 2002-11-06 15:45 ` Stefan Monnier
0 siblings, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2002-11-06 15:45 UTC (permalink / raw)
Cc: Bkey1, emacs-devel
> > I have managed to get emacsclient to build under Windows. However, I cannot
> > test it because whenever I call server-start, I get a "Unknown address
> > family" error message. I spent some time debugging this and I found that it
> > is being generated by the built in function "make-network-process" in
> > process.c, line 2749. I am at a loss as to how to resolve this problem.
>
> I assume that's because in server.el, make-network-process is called with
> these args:
> :family 'local :service server-socket-name
>
> This only works if AF_LOCAL (aka. AF_UNIX) is supported by the O/S --
> so I would assume it isn't supported on Windoze...
>
> Probably, the solution is to use a local network connection if
> :family 'local isn't supported. This can be tested in lisp with
>
> (featurep 'make-network-process '(:family local))
>
> Maybe Stefan can help you here.
How did it work with emacsserver.c ?
Stefan
PS: Using network connections is a lot of work, because you then
have to be super-extra-careful with security issues and you need
to change emacsclient.c.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: server-start under Windows
2002-11-06 14:34 bkey1
@ 2002-11-06 15:55 ` Stefan Monnier
2002-11-06 20:02 ` Jason Rumney
0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2002-11-06 15:55 UTC (permalink / raw)
Cc: emacs-devel
> storm@cua.dk wrote:
> > Probably, the solution is to use a local network connection if
> > :family 'local isn't supported. This can be tested in lisp with
> >
> > (featurep 'make-network-process '(:family local))
> >
> > Maybe Stefan can help you here.
>
> Stephan, can you provide any assistance with this issue? If you can give me an
> idea what needs to be changed, I would be more than willing to make the change.
>
> Just as a reminder, the issue at hand is that I have managed to port
> emacsclient to Windows but I cannot test it because I get the following error
> when I call server-start
> "Unknown address family"
> due to a failure in the built in function "make-network-process" (process.c,
> line 2749).
I only wrote server.el which uses make-network-process.
You'll need to hack process.c like you did for emacsclient.c to make
it understand `local' connections (I assume that w32 has unix-domain
sockets of some sort). Could you show us the patches you needed to
apply to emacsclient.c ?
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: server-start under Windows
@ 2002-11-06 20:01 bkey1
2002-11-07 14:49 ` Stefan Monnier
0 siblings, 1 reply; 9+ messages in thread
From: bkey1 @ 2002-11-06 20:01 UTC (permalink / raw)
Cc: emacs-devel
"Stefan Monnier" <monnier@rum.cs.yale.edu> wrote
> You'll need to hack process.c like you did for emacsclient.c to make
> it understand `local' connections (I assume that w32 has unix-domain
> sockets of some sort).
It appear as if most of this has been done. I just do not know what
make-network-process is supposed to be doing so I cannot tell what is going
wrong. If someone knows how make-network-process is supposed to work and can
provide a few pointers I may be able to figure it out.
> Could you show us the patches you needed to
> apply to emacsclient.c ?
I would be more than happy to provide a patch for emacsclient.c that
incorporates my changes. I had wanted to be able to test my work before doing
so, but I could send it to the list tonight with the disclaimer that it is
almost completely untested.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: server-start under Windows
2002-11-06 15:55 ` Stefan Monnier
@ 2002-11-06 20:02 ` Jason Rumney
2002-11-08 14:53 ` Kim F. Storm
0 siblings, 1 reply; 9+ messages in thread
From: Jason Rumney @ 2002-11-06 20:02 UTC (permalink / raw)
Cc: bkey1, emacs-devel
"Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu> writes:
> I only wrote server.el which uses make-network-process.
> You'll need to hack process.c like you did for emacsclient.c to make
> it understand `local' connections (I assume that w32 has unix-domain
> sockets of some sort).
It doesn't, which makes me wonder how much hacking went into
emacsclient.c, or maybe it will also start failing once the server
side is working.
Giving server.el a fallback of opening a TCP socket on localhost is
probably good enough. Unix-like systems will support AF_LOCAL, and
MS-Windows systems do not need to worry so much about multiple users,
so the security implications are mitigated.
I'm not sure that server sockets are stable on MS-Windows, but
getting server.el going will be a good test.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: server-start under Windows
2002-11-06 20:01 bkey1
@ 2002-11-07 14:49 ` Stefan Monnier
0 siblings, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2002-11-07 14:49 UTC (permalink / raw)
Cc: Stefan Monnier, emacs-devel
> "Stefan Monnier" <monnier@rum.cs.yale.edu> wrote
>
> > You'll need to hack process.c like you did for emacsclient.c to make
> > it understand `local' connections (I assume that w32 has unix-domain
> > sockets of some sort).
>
> It appear as if most of this has been done. I just do not know what
> make-network-process is supposed to be doing so I cannot tell what is going
> wrong. If someone knows how make-network-process is supposed to work and can
> provide a few pointers I may be able to figure it out.
Can you try to work it out with Kim <storm@cua.dk> (the author of the
original Unix code) and with Jason <jasonr@gnu.org> (who I think had
something to do with adapting it to w32) ?
> > Could you show us the patches you needed to
> > apply to emacsclient.c ?
>
> I would be more than happy to provide a patch for emacsclient.c that
> incorporates my changes. I had wanted to be able to test my work before
> doing so, but I could send it to the list tonight with the disclaimer that
> it is almost completely untested.
I wanted to see the patch just to get some idea of what might be needed
in process.c. I send untested patches all the time, so don't worry about
it ;-).
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: server-start under Windows
2002-11-06 20:02 ` Jason Rumney
@ 2002-11-08 14:53 ` Kim F. Storm
0 siblings, 0 replies; 9+ messages in thread
From: Kim F. Storm @ 2002-11-08 14:53 UTC (permalink / raw)
Cc: Stefan Monnier, bkey1, emacs-devel
Jason Rumney <jasonr@gnu.org> writes:
> "Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu> writes:
>
> > I only wrote server.el which uses make-network-process.
> > You'll need to hack process.c like you did for emacsclient.c to make
> > it understand `local' connections (I assume that w32 has unix-domain
> > sockets of some sort).
>
> It doesn't, which makes me wonder how much hacking went into
> emacsclient.c, or maybe it will also start failing once the server
> side is working.
I foun this in the patch to emacsclient.c -- it seems to assume
that AF_UNIX is supported (but just not documented)?! That may
be true, but it seems questionalbe to me...
--- _21.3/lib-src/emacsclient.c 2002-09-30 20:45:30.000000000 -0400
+++ 21.3/lib-src/emacsclient.c 2002-11-06 23:47:58.000000000 -0500
@@ -40,7 +40,18 @@
#else
# include <pwd.h>
#endif /* not VMS */
-
+#ifdef WINDOWSNT
+# include <errno.h>
+# include <fcntl.h>
+ extern int _execvp (const char*, char* const*);
+# ifndef HAVE_STRUCT_SOCKADDR_UN
+ struct sockaddr_un
+ {
+ short int sun_family; /* AF_UNIX */
+ char sun_path[108]; /* path name (gag) */
+ };
+# endif
+#endif
char *getenv (), *getwd ();
char *getcwd ();
--
Kim F. Storm <storm@cua.dk> http://www.cua.dk
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2002-11-08 14:53 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-06 4:45 server-start under Windows Ben Key
2002-11-06 9:53 ` Kim F. Storm
2002-11-06 15:45 ` Stefan Monnier
-- strict thread matches above, loose matches on Subject: below --
2002-11-06 14:34 bkey1
2002-11-06 15:55 ` Stefan Monnier
2002-11-06 20:02 ` Jason Rumney
2002-11-08 14:53 ` Kim F. Storm
2002-11-06 20:01 bkey1
2002-11-07 14:49 ` Stefan Monnier
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).