Linux-Development-Apps Digest #410, Volume #7    Thu, 17 May 01 12:13:13 EDT

Contents:
  Re: SIGSEGV is not blocking (Kasper Dupont)
  Cross compiling from Windows to Linux (Daniel Lux)
  Re: SIGSEGV is not blocking (Kasper Dupont)
  Re: SIGSEGV is not blocking (Kasper Dupont)
  Re: How do I make a messagebox?? (Frank Ranner)
  Re: Cross compiling from Windows to Linux ("jacob navia")
  Re: Cross compiling from Windows to Linux (Chris)
  Re: Cross compiling from Windows to Linux (Daniel Lux)
  Re: Cross compiling from Windows to Linux (Daniel Lux)
  Re: Cross compiling from Windows to Linux (Chris)
  Re: Cross compiling from Windows to Linux (Daniel Lux)
  Development tools ("Bourgeon Stéphane")
  timeout for non blocking sockets ("TdC")
  Re: Newbie programmer ("William Dandreta")
  Re: Cross compiling from Windows to Linux (Mumit Khan)
  Re: timeout for non blocking sockets (Kaz Kylheku)
  Re: Cross compiling from Windows to Linux ("Bill Medland")
  Re: timeout for non blocking sockets ("TdC")

----------------------------------------------------------------------------

From: Kasper Dupont <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.system,comp.programming.threads
Subject: Re: SIGSEGV is not blocking
Date: Thu, 17 May 2001 10:21:09 +0000

[EMAIL PROTECTED] wrote:
> 
> In article <[EMAIL PROTECTED]>,
> Vishnu Vardhan C K  <[EMAIL PROTECTED]> wrote:
> 
> >> Where is your program going to go after a seg fault?  That's why the
> >> results are undefined.
> 
> >I am not sure i am talking sense here, but would it make sense
> >to do a longjump from the signal handler ?
> >
> >I don't know just guessing..
> 
> A longjump from the handler would probably be ok but we're talking
> about blocking or delay the signal.  Being able to just continue on
> with the next instruction could get very strange.  I doubt it would
> be too useful.
> 
> --
> http://www.spinics.net/linux

A longjump is probably the only sensible way to return
from a SIGSEGV handler. But notice there is a special
siglongjump variant in which handling of signal
blocking masks is actually specified. Using a plain
longjump it is unspecified wether the mask will be
restored.

Continuing with the next instruction would probably be
very hard. Usually the return address points to the
failing instruction so just returning would retry the
same instruction, failing over and over again. But no
specifikation says it has to be that way.

Reading the program counter and interpretting the
instruction you can figure out what happened and how
long the instruction is. That way you can continue
with the next instruction. This requires lots of code
and is not portable, that is very seldom a good
solution.

-- 
Kasper Dupont

------------------------------

From: Daniel Lux <[EMAIL PROTECTED]>
Subject: Cross compiling from Windows to Linux
Date: Thu, 17 May 2001 12:57:57 +0200
Reply-To: [EMAIL PROTECTED]

We are using a cvs like system in our company wich runs under windows only,
we are now developing programs for linux and would like to cross compile 
under windows to linux. 
I already took a look at cygwin, but could not see any switches for cross 
compilation to linux.
Are there any other compilers which can run under windows/dos and that can 
cross compile to linux or does any one know what the switches are for 
cygwin?

Daniel Tram Lux

------------------------------

From: Kasper Dupont <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.system,comp.programming.threads
Subject: Re: SIGSEGV is not blocking
Date: Thu, 17 May 2001 10:52:24 +0000

Robert Redelmeier wrote:
> 
> David Schwartz wrote:
> >
> > Linus Torvalds wrote:
> >
> > > Now, you might say that killing is better. I might agree. We can vote on
> > > it, I don't personally particularly care one way or the other. But you
> > > only get those two choices: kill the dang thing outright, or just ignore
> > > the blocking. We just don't have any other good choices.
> >
> >         Well, you could spin forever, faulting on the instruction and then
> > retrying it because the signal was blocked. One could argue that this is
> > the most theoretically perfect thing to do, but it's hardly useful
> > behavior under any circumstances I can imagine.
> 
> It could be worse than that.  The continuously generated interrupt
> could prevent the scheduler from ever running, and the machine would
> be effectively locked-up.
> 
> -- Robert

The kernel will have the option to schedule once
at the end of every trap. Interrupts could be
allowed to happen just after the IRET returning
to userspace but just before reexecuting the
failing instruction. I don't know if the Intel
architecture actually will do that.

If this would lock-up the machine I can think of
lots of similar ways to lock-up the machine
which the kernel doesn't know about. I will try
changing my kernel to retry and see if it locks
up, I don't believe it will.

-- 
Kasper Dupont

------------------------------

From: Kasper Dupont <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.system,comp.programming.threads
Subject: Re: SIGSEGV is not blocking
Date: Thu, 17 May 2001 10:47:00 +0000

David Schwartz wrote:
> 
> Linus Torvalds wrote:
> 
> > Now, you might say that killing is better. I might agree. We can vote on
> > it, I don't personally particularly care one way or the other. But you
> > only get those two choices: kill the dang thing outright, or just ignore
> > the blocking. We just don't have any other good choices.
> 
>         Well, you could spin forever, faulting on the instruction and then
> retrying it because the signal was blocked. One could argue that this is
> the most theoretically perfect thing to do, but it's hardly useful
> behavior under any circumstances I can imagine.
> 
>         DS

Using 99% of the CPU time to do nothing doesn't
sound like a great idea. But you since the kernel
has detected this situation it would be posible
to try at most once pr. time slice. That would
definitly be a lot better, but if the programmer
wanted the program to do nothing until it is
sent a signal he should use the sigsuspend()
function instead.

-- 
Kasper Dupont

------------------------------

From: Frank Ranner <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.x
Subject: Re: How do I make a messagebox??
Date: Thu, 17 May 2001 21:07:48 +1000

Cam Stobbe wrote:
> 
> Does Linux have a function that is equivalent or similar to the
> MessageBox in Windows?
> 
> I am coding a simple application in C. It will not have a full-blown
> GUI. I just want to throw up a message box.
> 
> I am using RedHat 6.2.

xmessage "Hello Programmer"

xmessage on its own will give you the options.

Frank

------------------------------

From: "jacob navia" <[EMAIL PROTECTED]>
Subject: Re: Cross compiling from Windows to Linux
Date: Thu, 17 May 2001 13:09:06 +0200

As far as I know, this is impossible.
1) Windows is not Unix, and if you write
    int c = fork();
   it will not run under windows...  There is quite a run time gap here!

2) The object format is ELF under Linux, PE under windows. This *could* be
done by a cross-compiler, but you would have to get all linux libraries
under windows, to be able to link the program. This is not difficult
(storage is now cheaper), but there is no software now that does this;
you would have to port all the binutils to windows first.

The easiest way is to install both OSes, and reboot for each compilation. Or
to install a virtual machine that allows you to run both OSes at the same
time.


"Daniel Lux" <[EMAIL PROTECTED]> wrote in message
news:9e0ae8$dsq$[EMAIL PROTECTED]...
> We are using a cvs like system in our company wich runs under windows
only,
> we are now developing programs for linux and would like to cross compile
> under windows to linux.
> I already took a look at cygwin, but could not see any switches for cross
> compilation to linux.
> Are there any other compilers which can run under windows/dos and that can
> cross compile to linux or does any one know what the switches are for
> cygwin?
>
> Daniel Tram Lux



------------------------------

From: Chris <[EMAIL PROTECTED]>
Subject: Re: Cross compiling from Windows to Linux
Date: Thu, 17 May 2001 12:32:55 +0100

Daniel Lux wrote:
> 
> We are using a cvs like system in our company wich runs under windows only,
> we are now developing programs for linux and would like to cross compile
> under windows to linux.

This would be difficult and painful, I expect.

Why not write a little bit of code which checks out the
source from your existing revision control system and
copies it over to a Linux machine for building? It sounds
like you intend to do editing on Win32; if you are using
Developer Studio, it might even be possible to automate
all of this by creating compile commands which call make
or GCC on the remote machine.

-- 
Chris Lightfoot -- chris at ex dash parrot dot com -- www.ex-parrot.com/~chris/
 ``Hello,'' he lied. (Don Carpenter, quoting a Hollywood agent)

------------------------------

From: Daniel Lux <[EMAIL PROTECTED]>
Subject: Re: Cross compiling from Windows to Linux
Date: Thu, 17 May 2001 14:02:28 +0200
Reply-To: [EMAIL PROTECTED]

jacob navia wrote:

> As far as I know, this is impossible.
> 1) Windows is not Unix, and if you write
>     int c = fork();
>    it will not run under windows...  There is quite a run time gap here!
> 
> 2) The object format is ELF under Linux, PE under windows. This *could* be
> done by a cross-compiler, but you would have to get all linux libraries
> under windows, to be able to link the program. This is not difficult
> (storage is now cheaper), but there is no software now that does this;
> you would have to port all the binutils to windows first.
> 
> The easiest way is to install both OSes, and reboot for each compilation.
> Or to install a virtual machine that allows you to run both OSes at the
> same time.
> 
> 
> "Daniel Lux" <[EMAIL PROTECTED]> wrote in message
> news:9e0ae8$dsq$[EMAIL PROTECTED]...
>> We are using a cvs like system in our company wich runs under windows
> only,
>> we are now developing programs for linux and would like to cross compile
>> under windows to linux.
>> I already took a look at cygwin, but could not see any switches for cross
>> compilation to linux.
>> Are there any other compilers which can run under windows/dos and that
>> can cross compile to linux or does any one know what the switches are for
>> cygwin?
>>
>> Daniel Tram Lux
> 
> 
> 
I do not intend to run the compiled program under windows, I only want to 
compile under windows.  
All the binutils are already ported in the form of cygwin.
It is exactly the cross compiler that you mentioned that I am looking for.
I do not need both OS'es on one machine as the linux program will run on a 
dedicated linux machine.

------------------------------

From: Daniel Lux <[EMAIL PROTECTED]>
Subject: Re: Cross compiling from Windows to Linux
Date: Thu, 17 May 2001 14:38:28 +0200
Reply-To: [EMAIL PROTECTED]

the cvs like tool we use is called pvcs if this helps.
would it be possible to start the compilation by using samba 
or the likes?
I do have some knowledge on how to do it the other way round 
(cvs on a linux machine and checking out to a windows machine
using ssh and wincvs) The thing is, that the windows system is backed up 
regularly and hosts all our source code.

We do indeed intend to do editing on Win32 as I am the only 
one in the company with knowledge of linux (it was hard enough
convincing the management of using linux in the first place) and
there are some programmers which are naturally very attached to 
their Win32 editing tools.


Chris wrote:

> Daniel Lux wrote:
>> 
>> We are using a cvs like system in our company wich runs under windows
>> only, we are now developing programs for linux and would like to cross
>> compile under windows to linux.
> 
> This would be difficult and painful, I expect.
> 
> Why not write a little bit of code which checks out the
> source from your existing revision control system and
> copies it over to a Linux machine for building? It sounds
> like you intend to do editing on Win32; if you are using
> Developer Studio, it might even be possible to automate
> all of this by creating compile commands which call make
> or GCC on the remote machine.
> 


------------------------------

From: Chris <[EMAIL PROTECTED]>
Subject: Re: Cross compiling from Windows to Linux
Date: Thu, 17 May 2001 13:42:16 +0100

Daniel Lux wrote:
> 
> the cvs like tool we use is called pvcs if this helps.
> would it be possible to start the compilation by using samba
> or the likes?
> I do have some knowledge on how to do it the other way round
> (cvs on a linux machine and checking out to a windows machine
> using ssh and wincvs) The thing is, that the windows system is backed up
> regularly and hosts all our source code.
> 
> We do indeed intend to do editing on Win32 as I am the only
> one in the company with knowledge of linux (it was hard enough
> convincing the management of using linux in the first place) and
> there are some programmers which are naturally very attached to
> their Win32 editing tools.

I don't know anything about pcvs in particular, although
there is a web page at

        http://www.pvcs.synergex.com/pvcs-plt.htm

which suggests that linux support for it exists. Perhaps
that would be a good route to go down?


-- 
Chris Lightfoot -- chris at ex dash parrot dot com -- www.ex-parrot.com/~chris/
 The University of California Department of Statistics...
 where mean is normal, and deviation standard

------------------------------

From: Daniel Lux <[EMAIL PROTECTED]>
Subject: Re: Cross compiling from Windows to Linux
Date: Thu, 17 May 2001 15:27:40 +0200
Reply-To: [EMAIL PROTECTED]

That sounds like a possible solution...Do it like water,
follow the way of least resistance ;-)

Chris wrote:

> Daniel Lux wrote:
>> 
>> the cvs like tool we use is called pvcs if this helps.
>> would it be possible to start the compilation by using samba
>> or the likes?
>> I do have some knowledge on how to do it the other way round
>> (cvs on a linux machine and checking out to a windows machine
>> using ssh and wincvs) The thing is, that the windows system is backed up
>> regularly and hosts all our source code.
>> 
>> We do indeed intend to do editing on Win32 as I am the only
>> one in the company with knowledge of linux (it was hard enough
>> convincing the management of using linux in the first place) and
>> there are some programmers which are naturally very attached to
>> their Win32 editing tools.
> 
> I don't know anything about pcvs in particular, although
> there is a web page at
> 
> http://www.pvcs.synergex.com/pvcs-plt.htm
> 
> which suggests that linux support for it exists. Perhaps
> that would be a good route to go down?
> 
> 


------------------------------

From: "Bourgeon Stéphane" <[EMAIL PROTECTED]>
Subject: Development tools
Date: Thu, 17 May 2001 16:38:37 +0200

I have to move a Microsoft Windows (NT 4.0) application to Linux.
This multi-threading application has an MMI (displaying bitmaps, using tabs)
and it's running on a bi-processors machine.

What tools can I use to realize this porting ?
- Linux version,
- Development tool (as Visual C++ ???),
- Graphic libraries,
- Powerful debugger (multi-threading).

Thanks.




------------------------------

From: "TdC" <no#[EMAIL PROTECTED]#spam>
Subject: timeout for non blocking sockets
Date: Thu, 17 May 2001 14:37:06 GMT

i'm trying to create a time for my connection
so when it doesn't connect for 3 seconds, it should give up
here is my code

 int fd, numbytes;
 char buf[BUFFERSIZE];
 struct hostent *he;
 struct sockaddr_in server;
// here some code that puts the host in proxyip and the
// port in proxyport, i cut it so it wouldn't be so large when i post this
   int iproxyport = atoi(proxyport);  /*convert the char proxyport to int
iporxyport */
   if ((he=gethostbyname(proxyip))==NULL) {
   printf("gethostbyname() error\n");
   continue;
  }
  if ((fd=socket(AF_INET, SOCK_STREAM, 0))==-1) {
   printf("socket() error\n");
   continue;
  }

/*set  it to non bloacking*/
  fcntl(fd, F_SETFL, O_NONBLOCK);

  server.sin_family = AF_INET;
  server.sin_port = htons(iproxyport);
  server.sin_addr = *((struct in_addr *)he->h_addr);

  bzero(&(server.sin_zero),8);

  fd_set MySet;
  FD_ZERO(&MySet);
  FD_SET(fd, &MySet);
  /*set the timeout */
  timeval Interval;
  Interval.tv_sec = 3;

  connect(fd, (struct sockaddr *)&server,sizeof(struct sockaddr));

  if (select(FD_SETSIZE, NULL, &MySet, NULL, &Interval) != 1)
  {
   printf("timeout?\n");
   break;
  }

  /* we are connected recv etc here */

i don't understand why it doesn't work
:(




------------------------------

From: "William Dandreta" <[EMAIL PROTECTED]>
Crossposted-To: alt.os.linux.mandrake,comp.os.linux.development.system
Subject: Re: Newbie programmer
Date: Thu, 17 May 2001 14:42:18 GMT

Hi Kasper,

>Where do you have that GPL information from,
>the only information I could found was an
>article from november 13th november 2000
>with the title:
>
>"Borland to Release CLX Under Dual License,
>Kylix Will Not be Open Source"
>
>From long time Delphi users that have unofficial word from Borland.

Bill



------------------------------

From: [EMAIL PROTECTED] (Mumit Khan)
Subject: Re: Cross compiling from Windows to Linux
Date: 17 May 2001 14:48:08 GMT

In article <9e0ae8$dsq$[EMAIL PROTECTED]>,
Daniel Lux  <[EMAIL PROTECTED]> wrote:
>We are using a cvs like system in our company wich runs under windows only,
>we are now developing programs for linux and would like to cross compile 
>under windows to linux. 
>I already took a look at cygwin, but could not see any switches for cross 
>compilation to linux.
>Are there any other compilers which can run under windows/dos and that can 
>cross compile to linux or does any one know what the switches are for 
>cygwin?


You'll have to first build a cross-development toolchain of course, hosted
on i686-pc-cygwin targetted for i686-pc-linux-gnu for example.

See 
http://www.nanotech.wisc.edu/~khan/software/gnu-win32/cygwin-to-linux-cross-howto.txt

Regards,
Mumit



------------------------------

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: timeout for non blocking sockets
Reply-To: [EMAIL PROTECTED]
Date: Thu, 17 May 2001 15:43:03 GMT

On Thu, 17 May 2001 14:37:06 GMT, TdC <no#[EMAIL PROTECTED]#spam> wrote:
>i'm trying to create a time for my connection
>so when it doesn't connect for 3 seconds, it should give up
>here is my code

>  /*set the timeout */
>  timeval Interval;
>  Interval.tv_sec = 3;

You don't suppose that struct timeval has other members
that need to be initialized?

------------------------------

From: "Bill Medland" <[EMAIL PROTECTED]>
Subject: Re: Cross compiling from Windows to Linux
Date: 17 May 2001 15:54:05 GMT

How about something like this?

Share a directory on your windows machine
Use Samba so that the Linux box can see it
Get the code out using PVCS on the Windows box to the shared directory
cp -r to <wherever> on the linux box to cut down network traffic etc.
find <wherever> -type f -exec dos2unix {} \; (gcc won't like DOS
end-of-line formats)
build on the linux box.

Bill

-snip


------------------------------

From: "TdC" <no#[EMAIL PROTECTED]#spam>
Subject: Re: timeout for non blocking sockets
Date: Thu, 17 May 2001 16:06:01 GMT


"Kaz Kylheku" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> On Thu, 17 May 2001 14:37:06 GMT, TdC <no#[EMAIL PROTECTED]#spam> wrote:
> >i'm trying to create a time for my connection
> >so when it doesn't connect for 3 seconds, it should give up
> >here is my code
>
> >  /*set the timeout */
> >  timeval Interval;
> >  Interval.tv_sec = 3;
>
> You don't suppose that struct timeval has other members
> that need to be initialized?

um yes
Interval.tv_usec = 3000;

but it doesn't work with that added too



------------------------------


** FOR YOUR REFERENCE **

The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:

    Internet: [EMAIL PROTECTED]

You can send mail to the entire list by posting to the
comp.os.linux.development.apps newsgroup.

Linux may be obtained via one of these FTP sites:
    ftp.funet.fi                                pub/Linux
    tsx-11.mit.edu                              pub/linux
    sunsite.unc.edu                             pub/Linux

End of Linux-Development-Apps Digest
******************************

Reply via email to