Linux-Development-Sys Digest #993, Volume #6     Mon, 26 Jul 99 09:15:19 EDT

Contents:
  Re: NT to Linux port questions (David Schwartz)
  Re: Advice on source control for cross-border devlpmnt (David Schwartz)
  Re: Asynchronous IO networking Stack? (David Schwartz)
  Re: NT to Linux port questions (David Schwartz)
  Re: NT to Linux port questions (David Schwartz)
  HELP!!!  "Cannot connect to X Server" (Ed & Karen Hendrickson)
  Return code of IPC System Calls (Philippe Campi)
  Re: IO Completion Ports (David Schwartz)
  Re: HELP!!!  "Cannot connect to X Server" ("Rapha�l Co�ffic")
  Re: Strange compilation problems under Redhat 6.0 (Andreas Jaeger)
  Re: Problem with glibc compilation (Primary libc)! (Andreas Jaeger)
  Re: HELP!!!  "Cannot connect to X Server" (Carlos Vidal)
  Re: when will Linux support > 2GB file size??? (Robert Krawitz)
  Re: Why ignore a theoretical possibility? (Mark Tranchant)
  can't compile SMP driver with -D__SMP__ in 2.2.X ("robert_c")

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

From: David Schwartz <[EMAIL PROTECTED]>
Subject: Re: NT to Linux port questions
Date: Mon, 26 Jul 1999 00:05:43 -0700


> OK but it's still easy to emulate "wait for all events" in select() if
> you really need it -- but I can't think why you would.

        Present the code. I believe it is impossible to do this. By the time
you've concluded that the last file descriptor is ready, the first one
may no longer be. And by the time you've decided to retest, none of them
may be ready any more.

        Though this is a moot point since the functionality discussed is pretty
much useless. The closees to an application I can think of is a proxy
wanting to do a non-blocking read from one socket only if we can do a
non-blocking write to another. But since there's no guarantee you could
write the whole read, ...

        DS

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

From: David Schwartz <[EMAIL PROTECTED]>
Subject: Re: Advice on source control for cross-border devlpmnt
Date: Mon, 26 Jul 1999 00:21:15 -0700


> geographic locale.  Basically it seems like the slow connection makes
> everything from checking stuff out to checking stuff in an insanely long and
> laborious process such that they avoid merging their changes into our area
> on a timely basis.
> 
> Consequently, this results in them checking in tons of shit at once at very
> very distant intervals which then result in mega-painful integration since
> our area is so dynamic that by the time they check stuff in, it is way way
> out-of-synch and invariably blows up the build.

        Is it too far out of your budged to invest in some reasonable network
infrastructure? Perhaps on your end, you could add a T1 to a network
that has good routes to wherever they are. Perhaps they need to change
ISPs or invest in a higher level of service.

        You _can_ fix the hardware.

        DS

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

From: David Schwartz <[EMAIL PROTECTED]>
Subject: Re: Asynchronous IO networking Stack?
Date: Mon, 26 Jul 1999 00:19:28 -0700


        I don't think this is really a sensible thing to do. How you do
efficient network I/O on WIN32 is just very different from how you do it
on UNIX. There's no particular reason either OS should adopt the other's
model unless it resulted in an efficiency gain.

        But my understanding is that select/poll are implemented on UNIXes
because that's how the internals would like to let you know what's going
on. And Overlapped I/O is implemented in WIN32 because that's how those
kernels 'think' internally.

        There are a few nice features of each that would be nice to have on the
other. But there will always be some 'best way' to do thing on WIN32 and
some 'best way' to do them on various UNIXes, and they are unlikely to
be the same. Heck, my optimized FreeBSD network I/O code looks nothing
like my optimized Linux code.

        DS

Francois Payette wrote:
> 
> Is there anything like Winsock Overlapped i/o in the current Linux Kernel?
> 
> If not, is there a project on the way?
> 
> TIA
> Francois

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

From: David Schwartz <[EMAIL PROTECTED]>
Subject: Re: NT to Linux port questions
Date: Mon, 26 Jul 1999 00:11:32 -0700


        You can signal any number of conditions with the same condition
variable, thus allowing you to easily wait for any one of them or any
combination of them to occur. The problem with this is spurious wakeups.
If you want to do it right, you rearchitect so you no longer need to do
this.

        Otherwise, it's tedious, but you can code your own signal classes such
that each waiting thread has its own condition to sleep on and registers
in a list the conditional it is sleeping on and under what conditions it
would like to be woken. Then when another thread modifies any of those
conditions, it runs down the list of threads that might want to wake up
for that condition and wakes up the right ones.

        This allows you to wait for any single condition, any combination, or
even crazy things like 'X, but not Y'. And you will have _no_ spurious
wakeups, you can guarantee that a wakeup will never occur unless the
precisely desired combination occured.

        But again, as I said, there are very few reasons to ever need this.

        DS

Heinz H�berle wrote:
> 
> The only thing I have seen is the combination pthread_mutex and
> pthread_cond. I have built
> an event-system like windows. But only single events (its easy). You have
> to code something
> for a multiple object. but if you have events and semaphores it's possible!
> 
> > timers, and thread handles.  Does Linux have something similar.  ie. a
> > mechanism
> > that allows a thread to wait for any one of a number of event to signal?
> >

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

From: David Schwartz <[EMAIL PROTECTED]>
Subject: Re: NT to Linux port questions
Date: Sun, 25 Jul 1999 23:59:59 -0700


> THe MS WaitForMultipleEvents has the ability to be called so it doesn't
> return unless ALL handles become signaled SIMULTANEOUSLY select can't do
> this.

        Fortunately, it's almost never useful.

> Not to mention using either select() or poll() heavily in program
> can have very adverse effects on the speed of the program,

        Doing anything heavily can have adverse effects on the speed of the
program. *yawn*

> and btw
> select() and poll() are both blocking calls.

        That's the whole idea. You want your program to block until it has some
useful work to do. Otherwise you'd be wasting CPU.

> 
> To the best of my knowledge signal handlers are expensive things

        Just like messages are on WIN32, right?

        DS

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

From: Ed & Karen Hendrickson <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: HELP!!!  "Cannot connect to X Server"
Date: Mon, 26 Jul 1999 02:47:00 -0500

    I recently installed Linux-Mandrake 6.0 and was fiddling around with it.  I
figured out the hard way why you shouldn't just turn your computer off.  This, I
think, was the original cause of my problem.  After that in the bootup, it
checked a partition or mount or something to make sure it was fine, and it said
it was(or so it said).  When I tried to boot it up, it came to this ansi screen
that asked for name and password(it had always been there before, but just went
right on through to the GUI login screen.  I tried my norm user and password and
it brought me to the bash screen.  I typed "kde", and it looked like it started
trying to load it up, but on every little line, it said, cannot connect to x
server....  xmonitor(example): cannot connect to xserver.  It had several lines
of those, each with a different init.  I tried booting up with the boot disk I
had it create in the installation, and it did the same thing.  So I finally said
forget this, ran the installation again, and in the installation I think it
formatted the harddrive.  After I had installed it all....THE SAME THING.  So
you can see my dilemma....PLEASE HELP!!!    e-mail as soon as you can with a
solution....

    --Ryan Hendrickson
        [EMAIL PROTECTED]


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

From: Philippe Campi <[EMAIL PROTECTED]>
Subject: Return code of IPC System Calls
Date: Mon, 26 Jul 1999 09:17:16 +0200



I am using System V IPC Message Queue and I have noticed that msg*
system call return a negative value in case of failure.

On UNIX, these system calls return 0 on success or -1, as decribed in
the UNIX man abstract below (msgsnd(2) call) :

RETURN VALUES
     Upon successful completion, msgsnd() returns 0.   Otherwise, no
message  will be sent, msgsnd() will return -1 and errno will be set to
indicate the error.

ERRORS
     The msgsnd() function will fail if:

     EACCES    ......

Why  don't we choose the same convention for return values in order to
allow source portability between UNIX and Linux ?
Any idea ?



--
Philippe CAMPI

mailto: [EMAIL PROTECTED]



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

From: David Schwartz <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: IO Completion Ports
Date: Mon, 26 Jul 1999 00:28:11 -0700


        I don't think you would want this, in general. The reason people use
I/O Completion ports on NT is because it is the fastest way to do
network I/O. If a Linux implementation wasn't the fastest way to do
network I/O, it wouldn't be particularly interesting. Under current
Linux implementations, poll is the fastest way to do network I/O, so you
should use it.

        DS

Matthew Carl Schumaker wrote:
> 
> I've been trying to find info about IO completion ports under linux
> but the only info I have dates back to May of 1998
> 
> Anybody know if there has been any progress on that front?
> Pointers to Info?
> 
> thanks in advance
> matt
> 
> Matthew Carl Schumaker
> UPAC Lights Administrative Chairperson
> [EMAIL PROTECTED]
> veni, vedi, velcro
> I came, I saw, I stuck around

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

From: "Rapha�l Co�ffic" <[EMAIL PROTECTED]>
Subject: Re: HELP!!!  "Cannot connect to X Server"
Date: Mon, 26 Jul 1999 10:06:15 +0200

Ed & Karen Hendrickson wrote:

> I typed "kde", and it looked like it started
> trying to load it up, but on every little line, it said, cannot connect to x
> server....  xmonitor(example): cannot connect to xserver.  It had several lines
> of those, each with a different init.  I tried booting up with the boot disk I
> had it create in the installation, and it did the same thing.  So I finally said
> forget this, ran the installation again, and in the installation I think it
> formatted the harddrive.  After I had installed it all....THE SAME THING.  So
> you can see my dilemma....PLEASE HELP!!!    e-mail as soon as you can with a
> solution....
>
>     --Ryan Hendrickson
>         [EMAIL PROTECTED]

Kde is a window-manager which means that it only handle windows and that's all.
In order to work fine, it has to 'connect' to an X-Window server (e.g. XFREE86
under linux). That's why you never start it whith command line. In fact, you should
have run 'startx'. When 'startx' starts, it looks for a few scripts which will tell
him what window-manager to start with the X-Server. Check /etc/X11R6/Xsessions or
/etc/X11R6/Xdefaults.

Remember : X-Window is nothing without a window-manager and a window-manager can't
run without a running X-Server !

Bye,
Raf.


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

From: Andreas Jaeger <[EMAIL PROTECTED]>
Subject: Re: Strange compilation problems under Redhat 6.0
Date: 26 Jul 1999 07:59:55 +0200

>>>>> Zewei Chen writes:

 > Here's a simple program that does not compile under the
 > stock installation of Redhat 6.0.

 > #include <stdio.h>

 > FILE *f = stdout;

 > The error message I get is:

 > foo.c:3: initializer element is not constant

 > [...]

>From the glibc 2.1 FAQ that should be installed on your system:

3.9.    I get compiler messages "Initializer element not constant" with
        stdin/stdout/stderr. Why?

{RM,AJ} Constructs like:
   static FILE *InPtr = stdin;

lead to this message.  This is correct behaviour with glibc since stdin is
not a constant expression.  Please note that a strict reading of ISO C does
not allow above constructs.

One of the advantages of this is that you can assign to stdin, stdout, and
stderr just like any other global variable (e.g. `stdout = my_stream;'),
which can be very useful with custom streams that you can write with libio
(but beware this is not necessarily portable).  The reason to implement it
this way were versioning problems with the size of the FILE structure.

To fix those programs you've got to initialize the variable at run time.
This can be done, e.g. in main, like:

   static FILE *InPtr;
   int main(void)
   {
     InPtr = stdin;
   }

or by constructors (beware this is gcc specific):

   static FILE *InPtr;
   static void inPtr_construct (void) __attribute__((constructor));
   static void inPtr_construct (void) { InPtr = stdin; }

-- 
 Andreas Jaeger   [EMAIL PROTECTED]    [EMAIL PROTECTED]
  for pgp-key finger [EMAIL PROTECTED]

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

From: Andreas Jaeger <[EMAIL PROTECTED]>
Subject: Re: Problem with glibc compilation (Primary libc)!
Date: 26 Jul 1999 09:36:41 +0200

>>>>> Ilya Bassine writes:

Ilya> Andreas Jaeger wrote:
>> >>>>> Ilya Bassine writes:
>> > [.../
>> >         (All works fine till the moment when test-installation.pl.sh
>> > starts)
>> 
>> Have a look at the script itself and see what exactly goes wrong.  The
>> script is scripts/test-installation.pl and compiles a simple "hello
>> world" program linked against all libraries.  Do it yourself:
>> 
>> - Compile it, check ldd output.
>> - Compile it against all libraries (see what the script does).  Does
>> the script still work ?
>> 
>> Andreas

Ilya> Thanks!
Ilya> I've found the bug. It was a symbollink (not listed in HOW-TO) in /lib.
Ilya> libdl.so was linked to libdl.so.1 (libdl.so.1.9.9), and one of the tests uses
Ilya> it. This is lib compiled with libc5 and it gives error message.
Good that the script bailed out - those errors are weird and hard to
detect.

Ilya> Friday night I  successful installed glibc-2.1.1 The installation was
Ilya> checked.
Fine.

Ilya> After that pgcc, binutils, make were recompiled.
I hope you didn't try make 3.77 - or read the FAQ entry before.

Ilya> I build mysql-3.22.22, samba-2.0.5a, apapche-1.3.26, php-3.11 with new libc6.
Ilya> They works!
What do you expect? ;-)

Andreas
-- 
 Andreas Jaeger   [EMAIL PROTECTED]    [EMAIL PROTECTED]
  for pgp-key finger [EMAIL PROTECTED]

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

From: Carlos Vidal <[EMAIL PROTECTED]>
Subject: Re: HELP!!!  "Cannot connect to X Server"
Date: Mon, 26 Jul 1999 10:24:59 +0200

Ed & Karen Hendrickson wrote:
> When I tried to boot it up, it came to this ansi screen
> that asked for name and password(it had always been there 
> before, but just went
> right on through to the GUI login screen.  
> I tried my norm user and password and
> it brought me to the bash screen.  
> I typed "kde", and it looked like it started
> trying to load it up, but on every little line, 
> it said, cannot connect to x server....  xmonitor(example): 
> cannot connect to xserver.

Don't panic!

The system is right (once more!), you don't have an X-server running. I
you type 'startx' in the bash prompt you will start the server and then
the whole graphical environment.

In Linux (as in every Unix) you can boot your system to different
levels. What is allowed in each level is controlled with the file
'/etc/inittab'. 

The first non-commented line of this file in RH6.0 says:

        id:N:initdefault:

where 'N' is the running level. RH6.0 (and 4.x and 5.x) use N=3 for the
bash prompt you have now and N=5 to start directly in X (your former GUI
login screen). Therefore, if you write:

        id:5:initdefault:

the X-server will start automatically when booting.

Before booting in level 5 be sure that your X server is well configured,
that is, when you type 'startx' from your bash prompt everything starts
smoothly and works as expected (you will not have the GUI login, just
your GUI environment).

Just as an anecdotic background, in the good old days of shared computer
resources these levels were used to allow different groups of users to
efficiently use a CPU. For instance, in my university, from 9AM to 14PM
the system was in a running level allowing everybody with an account to
log in. All number crunching applications were either forbidden or run
with very low priority (see 'nice' command). From 14PM to 18PM only the
staff could log in and work with their developments. From 18PM to 8AM a
third level was entered where the queed tasks were run and the system
administrators could work. You can read 'man init' to see how this was
done.

Nowadays in most Linuxes you fall in level 1 if the system crashed
(normally because of a black out) and a file system cannot be
automatically recovered when booting. You get in level 1 and from there
you have to run 'fsck' manually. Level 3 is the default after
installation (multiuser mode but text based screens unless you type
'startx'). Level 5 is used to multiuser mode with graphical login (see
'xdm' documentation. In RH6.0 'kdm' is used, but is functionally
equivalent to 'xdm'). 


-- 
Carlos Vidal
[EMAIL PROTECTED]

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

From: Robert Krawitz <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.advocacy
Subject: Re: when will Linux support > 2GB file size???
Date: 26 Jul 1999 07:39:20 -0400

Graffiti <[EMAIL PROTECTED]> writes:

> In article <[EMAIL PROTECTED]>,

> 2) Forget about binary compatability and let the user handle all the
> breakage, and provide stuff like mmap64() (or whatever the LFS has
> come up with for 64-bit mmap().  If any).

That's exactly what they've done, except without breaking binary
compatibility; mmap64() is a new system call.

-- 
Robert Krawitz <[EMAIL PROTECTED]>      http://www.tiac.net/users/rlk/

Tall Clubs International  --  http://www.tall.org/ or 1-888-IM-TALL-2
Member of the League for Programming Freedom -- mail [EMAIL PROTECTED]

"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton

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

From: Mark Tranchant <[EMAIL PROTECTED]>
Subject: Re: Why ignore a theoretical possibility?
Date: Mon, 26 Jul 1999 12:43:11 +0100
Reply-To: [EMAIL PROTECTED]

You can do this already to some extent by saving your functions in
separate source files. The Linux source does this - you can modify just
one file, and only that file (in theory) need be recompiled, then linked
in.

Borland's reply is disappointing but realistic - recompilation of a
small source file already takes negligible time, and the re-linking of
the object files doesn't take too long either.

Mark.

Benedetto Proietti wrote:
> 
> Hi,
> my name is Benedetto and I am an italian mathematics student.
> Some time ago my information science professors and I have started
> thinking about the theoretical possibility to realize a compiler like
> this:
> - a source code is compiled for the first time and some information is
> saved about it.
> - following modifications of said source could be handled so that a very
> little portion of the source is recompiled, and the generated code is
> properly inserted into the (previously) compiled file. By little portion
> I mean single functions, statement or less!
> It is obviously a non-trivial task (=design and implementation),
> nevertheless it could be done. Following recompilations are estimated to
> take about 1 tenth of sec or less.
> 
> My first questions to you, that surely know very well compilers and
> development systems, are:
> Question 1- Could such kind of compiler be useful to you and your job?
> Question 2- Would you use this kind of "incremental" or "real time"
> compiler?
> Question 3- What other functionalities a compiler like that should have?
> 
> Some time ago I had the luck to meet the "Research & Development"
> Director of a very famous compiler company (Borland International).
> I told him about the possibility to build (with "some" effort) this kind
> of compiler and he answered me "Why have we to build this "incremental"
> compiler when we have computer every day faster and more powerful?"
> I understand that companies like Microsoft, Borland, ..., and especially
> Intel, dislike very powerful software (like compilers) that do not need
> fast machine to run on.
> Question 4:Why should we buy a new processor when our compiler takes 1
> tenth to compile normal programs and half second the big ones?
> Also, couldn't we use the time we save in the compilation for other
> things like optimizing code and use more abstract and powerful
> languages?
> Question 5:Can you imagine what kind of optimizations the compiler could
> do in those tens of seconds saved? I really cannot!
> 
> Are we so addicted to obsolescence mentality not to recognize new nice
> technologies? to avoid new technologies and new ideas at all?
> 
> I really thank you for the time dedicated to this idea.
> I will appreciate very much any comment to these problems, please feel
> free to answer to the newsgroup.
> 
> Bye
> Benedetto
> [EMAIL PROTECTED]

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

From: "robert_c" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.hardware
Subject: can't compile SMP driver with -D__SMP__ in 2.2.X
Date: 26 Jul 1999 12:07:06 GMT

Hello:

 Could someone tell me the answer about compiling error in SMP case(and I
make two experiments for this problem).

[Experiment1:]

Question 1:
when I compile a program(it works fine in kernel 2.0.X, ie. in UP)
with -D__SMP__, gcc told me some errors like following.

[root@robert MyDriver]# gcc -D__SMP__ -O -w -c MyDriver.c
/usr/include/asm/smp.h: In function hard_smp_processor_id':
In file included from /usr/include/linux/smp.h:11,
                 from /usr/include/linux/sched.h:20,
                 from MyDriver.h:23,------------------------->ie.  #include
<linux/sched.h>
/usr/include/asm/smp.h:209: APIC_BASE' undeclared (first use in this
function)
/usr/include/asm/smp.h:209: (Each undeclared identifier is reported only
once
/usr/include/asm/smp.h:209: for each function it appears in.)
/usr/include/asm/smp.h:209: APIC_ID' undeclared (first use in this function)
[root@robert MyDriver]#
============================================================================
=========================================
MyDriver.h like following.

#ifndef __KERNEL__
#  define __KERNEL__
#endif
#ifndef MODULE
#  define MODULE
#endif

#include <linux/modules.h>
#include <linux/sched.h>
#include <linux/kernel.h>
............

[Experiment 2:]

But, when I make a change from -D__SMP__ (in compile time) to write the
definition inside MYDriver.h like following and try again, compiling is  OK,
but insmod MYDriver.o has some error.

MyDriver.h:

#include <linux/config.h>
#ifdef
CONFIG_SMP<-----------------------------------------------------------------
============================================================================
=======
#undef __SMP__   <----------------------
#define __SMP__1<-----------------------
#endif                        <----------------------
#ifndef __KERNEL__
#  define __KERNEL__
#endif
#ifndef MODULE
#  define MODULE
#endif
....
+++++++++++++++++++++++++++++++++++++++++++++++++
Error like this:


[root@robert MyDriver]# gcc -O -w -c MyDriver.c
<--------Compile OK.
[root@robert MyDriver]# insmod -f Mydriver
Warning: kernel-module version mismatch
Question 2:
        ./MyDriver.o was compiled for kernel version 2.2.5-15<------Why UP,
not SMP?(because I have define __SMP__ like above MyDriver.h
        while this kernel is version 2.2.5-15smp

./MyDriver.o: unresolved symbol schedule_timeout
./MyDriver.o: unresolved symbol request_region
./MyDriver.o: unresolved symbol kmalloc
./MyDriver.o: unresolved symbol unregister_chrdev
./MyDriver.o: unresolved symbol register_chrdev
./MyDriver.o: unresolved symbol release_region
./MyDriver.o: unresolved symbol boot_cpu_data
./MyDriver.o: unresolved symbol kfree
./MyDriver.o: unresolved symbol __verify_write
./MyDriver.o: unresolved symbol memcpy_fromfs
./MyDriver.o: unresolved symbol check_region
./MyDriver.o: unresolved symbol jiffies
./MyDriver.o: unresolved symbol printk
./MyDriver.o: unresolved symbol add_timer

Question 3:
And Why has many unresolved symbols like above? (I can't make sure it is
relavant with -DMODVERSIONS or not, because I didn't use -DMODVERSIONS
option in compile time). I still make third experiment,ie. copy MYDriver.o
to /lib/modules/2.2.5-15smp/misc directory, and issues comand like:
insmod -f MyDriver.o, but still fail.

So, Could you give any advives.



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


** 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 (and comp.os.linux.development.system) via:

    Internet: [EMAIL PROTECTED]

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-System Digest
******************************

Reply via email to