New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not OK: perl v5.7.0 +DEVEL7928 on os2-64int-ld 2.30 (UNINSTALLED) #2917
Comments
From @ysthStill struggling with -Duseperlio... perlio.c: In function `PerlIOStdio_close': Here's a patch (though you may want to check USE_SOCKS instead): Inline Patch--- perlio.c.orig Wed Nov 29 14:50:22 2000
+++ perlio.c Wed Nov 29 14:54:38 2000
@@ -1449,12 +1449,16 @@
IV
PerlIOStdio_close(PerlIO *f)
{
+#ifdef HAS_SOCKET
int optval, optlen = sizeof(int);
+#endif
FILE *stdio = PerlIOSelf(f,PerlIOStdio)->stdio;
- return(
- (getsockopt(PerlIO_fileno(f), SOL_SOCKET, SO_TYPE, (char *)&optval, &optlen) < 0) ?
- fclose(stdio) :
- close(PerlIO_fileno(f)));
+ return
+#ifdef HAS_SOCKET
+ (getsockopt(PerlIO_fileno(f), SOL_SOCKET, SO_TYPE, (char *)&optval, &optlen) >= 0) ?
+ close(PerlIO_fileno(f)) :
+#endif
+ fclose(stdio);
}
IV
Then I got stuck on os2.c: os2.c: In function `do_spawn_ve': I tried changing it to use PerlIO calls but stopped when I found Perl Info
|
From [Unknown Contact. See original ticket]<sthoenna@efn.org> writes:
I hope that that horrible SOCKS hackery has gone in recent snapshot.
Which is where you should get stuck - and I do a bit as well. The 1st step is #define PERLIO_NOT_STDIO 0 at the top before including <perl.h>.
Here it is just taking a quick look at the file. So it could
One needs to follow PerlIO_tmpfile() through perlio.h and iperlsys.h my_tmpfile() is either not called or
There is a Perl_sv_gets() which is similar but uses $/ rather than '\n' So - try the #define - it may be sufficient.
|
From @ysthNick Ing-Simmons <nik@tiuk.ti.com> wrote:
It just got added in 7855 and modified in 7922. 7930 was Wednesday's snapshot.
Patch (for now--I need to look at the my_tmpfile situation more): Inline Patch--- os2/os2.c.orig Sun Oct 22 12:37:54 2000
+++ os2/os2.c Thu Nov 30 11:45:22 2000
@@ -21,6 +21,7 @@
#include <process.h>
#include <fcntl.h>
+#define PERLIO_NOT_STDIO 0
#include "EXTERN.h"
#include "perl.h"
@@ -605,8 +606,9 @@
char *scr = find_script(PL_Argv[0], TRUE, NULL, 0);
if (scr) {
- FILE *file;
- char *s = 0, *s1;
+ PerlIO *file;
+ SSize_t rd;
+ char *s = 0, *s1, *s2;
int l;
l = strlen(scr);
@@ -622,14 +624,18 @@
Safefree(scr);
scr = scrbuf;
- file = fopen(scr, "r");
+ file = PerlIO_open(scr, "r");
PL_Argv[0] = scr;
if (!file)
goto panic_file;
- if (!fgets(buf, sizeof buf, file)) { /* Empty... */
+ rd = PerlIO_read(file, buf, sizeof buf-1);
+ buf[rd]='\0';
+ if ((s2 = strchr(buf, '\n')) != NULL) *++s2 = '\0';
+
+ if (!rd) { /* Empty... */
buf[0] = 0;
- fclose(file);
+ PerlIO_close(file);
/* Special case: maybe from -Zexe build, so
there is an executable around (contrary to
documentation, DosQueryAppType sometimes (?)
@@ -648,7 +654,7 @@
} else
goto longbuf;
}
- if (fclose(file) != 0) { /* Failure */
+ if (PerlIO_close(file) != 0) { /* Failure */
panic_file:
Perl_warner(aTHX_ WARN_EXEC, "Error reading \"%s\": %s",
scr, Strerror(errno));
Thanks. I had looked at perlio.h but for some reason I was trying to On to the next problem: [D:\perl-current]miniperl -we"print qq:\n:"|od -tc Suggestions for where to look for where the extra \r comes from? |
From [Unknown Contact. See original ticket]Yitzchak Scott-Thoennes <sthoenna@efn.org> writes:
Okay, now we are in really messy bit. For standard handles (e.g. stdout above) which are already open then One other thing - all these tricks are gated by O_BINARY != O_TEXT The other possibility is that you are getting stdio layer and I have |
From @ysthNick Ing-Simmons <nik@tiuk.ti.com> wrote:
I have setmode, in a couple flavours: #include <stdio.h> [emx] int _fsetmode (FILE *stream, const char *mode); Change the text/binary mode of a stream. MODE must point either Return value: 0 success -1 error Restrictions: Do not call _fsetmode() on a stream with non-empty buffer. If See also: fopen() #include <io.h> [PC] int setmode (int handle, int mode); Change the text/binary mode of a file handle. MODE must be either Note: Use _fsetmode() to change the mode of a stream. Return value: If there's an error, setmode() returns -1 and sets errno to EBADF See also: _fsetmode(), open() #include <stdio.h> [UNIX] FILE *fdopen (int handle, const char *mode); Create a stream for the file handle HANDLE. The flags in the mode Return value: fdopen() returns a new stream. On error, fdopen() returns NULL. See also: fopen(), open()
[D:\emx\include]fgrep -e O_TEXT -e O_BINARY sys/fcntl.h
How do I ask for no stdio layer?
Seems like if XS is to be allowed to expect PerlIO_open (or fopen |
From [Unknown Contact. See original ticket]Yitzchak Scott-Thoennes <sthoenna@efn.org> writes:
We don't need that one (yet).
That is the one we want.
No stdio should be the default with O_TEXT and O_BINARY like that: perlio.c has: if (O_BINARY != O_TEXT)
Exactly.
Seems like what you have is basically the same as Win32 (as I might expect). PerlIO * Is not doing the right thing. |
From @ysthNick Ing-Simmons <nick@ing-simmons.net> wrote:
At this point, O_BINARY != O_TEXT, but in iperlsys.h these are not yet One fix would be to remove the define to 0. In the sources I have, Inline Patch--- iperlsys.h.orig Wed Nov 29 14:13:58 2000
+++ iperlsys.h Sat Dec 2 23:51:56 2000
@@ -667,12 +667,7 @@
#define PerlLIO_open3(file, flag, perm) open((file), (flag), (perm))
#define PerlLIO_read(fd, buf, count) read((fd), (buf), (count))
#define PerlLIO_rename(old, new) rename((old), (new))
-#if O_BINARY != O_TEXT
#define PerlLIO_setmode(fd, mode) setmode((fd), (mode))
-#else
-/* Until we have a "host" on UNIX to supply a stub #define it out */
-#define PerlLIO_setmode(fd, mode) 0
-#endif
#define PerlLIO_tmpnam(str) tmpnam((str))
#define PerlLIO_umask(mode) umask((mode))
#define PerlLIO_unlink(file) unlink((file))
End of Patch. |
Migrated from rt.perl.org#4804 (status was 'resolved')
Searchable as RT4804$
The text was updated successfully, but these errors were encountered: