Linux-Development-Sys Digest #120, Volume #7     Sun, 29 Aug 99 07:14:09 EDT

Contents:
  Re: Creating arbitrary ".o" files (Nix)
  Re: how to 'scandisk' in linux (James Stevenson)
  Re: where are packets created? (Nix)
  Re: IDE for c++ dev? (Nix)
  Re: Linux's faults (Robert Krawitz)
  Re: Outlook Express (Richard Wilson)
  Outlook Express
  Re: Linux's faults (Takeyasu Wakabayashi)
  Re: 497.2 days ought to be enough for everybody ("Ross Crawford")
  Re: Outlook Express (Kaz Kylheku)
  Help needed: kernel patch problem (Thomas Jaeger)
  Re: why not C++? (david parsons)
  Re: why not C++? ([EMAIL PROTECTED])
  Re: Help needed: kernel patch problem ("Marc Elvery")
  Re: how to 'scandisk' in linux (Bernd Strieder)
  Re: Writing my own Filesystem?  Possible? (Erez Zadok)

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

From: Nix <$}xinix{[email protected]>
Subject: Re: Creating arbitrary ".o" files
Date: 27 Aug 1999 23:21:58 +0100

[EMAIL PROTECTED] (Jason Neudorf) writes:

> I've looked through binutils, and haven't found anything like this (well,
> except winres, which I didn't think was applicable).  Is there a tool that
> I can use to store data with a given type?

objcopy can do this, but referring to the contents of arbitrary ELF
sections when your program is running may be tricky. Plus that would
constrain your program to a single executable format, and this is so
rare that except for kernels and C libraries and the like, I've never
seen *any* Unix programs that are so constrained. (Ignoring .so
considerations for the moment).

> I'd like something I could use like:
> 
> create_obj -type "char *" -name "foo" -infile "foo.gif" -outfile "foo.o"
> 
> and then be able to refer to "char *foo" in my program.

Ah, well in that case you want to write a create_obj program that picks up
your .gif file and generates a header containing the appropriate binary
data via C octal escapes. Then just #include that.

This is why eg xpm files have the format they do, for easy inclusion
into programs.

-- 
'- I can't believe my room doesn't have Ethernet!  Why wasn't it wired
   when the house was built?
 - The house was built in 1576.' --- Alex Kamilewicz on the Cambridge
                                     breed of `conference American'.

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

From: [EMAIL PROTECTED] (James Stevenson)
Crossposted-To: redhat.config,redhat.general
Subject: Re: how to 'scandisk' in linux
Reply-To: [EMAIL PROTECTED]
Date: Sat, 28 Aug 1999 22:53:16 +0000

Hi

man e2fsck

cya
        James

On Sat, 28 Aug 1999 20:30:59 GMT, zackary <[EMAIL PROTECTED]> wrote:
>hello guys
>
>  I wonder how to check my disk 'health', as in windows'XX' it have
> 'scandisk' to check the bad block, file system and etc. So what should i
> use to check those things in linux. Would you guys guide me.
> 
>  Thank You.
>
>-azaria-
>
>
>------------------  Posted via CNET Linux Help  ------------------
>                    http://www.searchlinux.com


-- 
=============================================
Check Out: http://www.users.zetnet.co.uk/james/
E-Mail: [EMAIL PROTECTED]
 10:50pm  up 2 days,  9:35,  5 users,  load average: 2.16, 2.24, 2.21

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

From: Nix <$}xinix{[email protected]>
Subject: Re: where are packets created?
Date: 28 Aug 1999 00:18:25 +0100

[EMAIL PROTECTED] (Peter Samuelson) writes:

> I saw a book the other day, "Routing TCP/IP" published by Cisco for $70
> or so.  It was about three inches thick.

Bah, Stevens. Four books[1], thousands of pages.

[1] OK so this includes APUE which isn't about TCP/IP. The rest are
    though.

-- 
'- I can't believe my room doesn't have Ethernet!  Why wasn't it wired
   when the house was built?
 - The house was built in 1576.' --- Alex Kamilewicz on the Cambridge
                                     breed of `conference American'.

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

From: Nix <$}xinix{[email protected]>
Subject: Re: IDE for c++ dev?
Date: 27 Aug 1999 23:28:21 +0100

[EMAIL PROTECTED] (Peter Samuelson) writes:

> [Johan Kullstam <[EMAIL PROTECTED]>]
> > i like emacs.  it's probably not exactly the same as what you are
> > looking for.  however, emacs will compile as a subprocess and jump to
> > errors.  it can browse source via etags.  you can run the debugger
> > from within emacs and emacs brings the source up for single stepping
> > through it.
> 
> What it doesn't do, of course, is manage projects graphically (unless
> you count make-mode...)

speedbar.el in xemacs sort of does that. Sort of.

After all, there is nothing that emacs cannot do. And that's
official.


Oh, other than display colours in a TTY. (But xemacs can do that
instead.) ;)

>                         but in my opinion (not worth too much since
> I've hardly ever used project-file IDE's) Makefiles are just as
> flexible and, with a bit of a learning curve, not at all hard to use.

autoconf, autoconf, autoconf --- *cough*.

Pardon me. I get these attacks, y'know.

-- 
'- I can't believe my room doesn't have Ethernet!  Why wasn't it wired
   when the house was built?
 - The house was built in 1576.' --- Alex Kamilewicz on the Cambridge
                                     breed of `conference American'.

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

From: Robert Krawitz <[EMAIL PROTECTED]>
Subject: Re: Linux's faults
Date: 28 Aug 1999 23:13:16 -0400

Nix <$}xinix{[email protected]> writes:

> Robert Krawitz <[EMAIL PROTECTED]> writes:
> 
> >          It's possible for processes to share memory by means of the
> > System V shared memory primitives (shmctl and such), or by mmap()'ing
> > a file shared (the traditional method).
> 
> Linux does not support anonymous shared mappings yet :(((

No, it doesn't...how annoying.  The line in the kernel /dev/zero
driver that specifically checks for it and rejects it I found most
annoying at my previous job.

However, one can get the same effect by mmap'ing an ordinary file, so
it's still possible to do the right thing, unless you have something
else in mind than what I'm thinking of.

-- 
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: [EMAIL PROTECTED] (Richard Wilson)
Crossposted-To: comp.os.linux.alpha,comp.os.linux.development.apps
Subject: Re: Outlook Express
Reply-To: [EMAIL PROTECTED]
Date: Sun, 29 Aug 1999 04:52:41 GMT

Sorry but I can't resist asking this because I'm really curious. Why
would you post a question in three very specific Linux newsgroups
about a Microsoft Windows application? Why here instead of in one (or
more) of the microsoft.public.* newsgroups?

On Sun, 29 Aug 1999 04:31:01 GMT, <[EMAIL PROTECTED]> wrote:
>My wife and I each have a computer and we share the same ISP.  We each 
>have Windows 98 and of course we both have Outlook Express.
>     Outlook Express is my wife's main e-mail address and I really have no 
>need for it.  What I'd like to do is transfer and the message and 
>addresses I have to her computer and then remove it from my computer.  
>Would this cause a major headache?  What would the proper procedure be?
>     Really looking forward to your response!      

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

From: <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.alpha,comp.os.linux.development.apps
Subject: Outlook Express
Date: Sun, 29 Aug 1999 04:31:01 GMT

My wife and I each have a computer and we share the same ISP.  We each 
have Windows 98 and of course we both have Outlook Express.
     Outlook Express is my wife's main e-mail address and I really have no 
need for it.  What I'd like to do is transfer and the message and 
addresses I have to her computer and then remove it from my computer.  
Would this cause a major headache?  What would the proper procedure be?
     Really looking forward to your response!      

==================  Posted via CNET Linux Help  ==================
                    http://www.searchlinux.com

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

From: Takeyasu Wakabayashi <[EMAIL PROTECTED]>
Subject: Re: Linux's faults
Date: 29 Aug 1999 12:17:59 +0900

Nix <$}xinix{[email protected]> writes:

> 
> Robert Krawitz <[EMAIL PROTECTED]> writes:
> 
> >          It's possible for processes to share memory by means of the
> > System V shared memory primitives (shmctl and such), or by mmap()'ing
> > a file shared (the traditional method).
> 
> Linux does not support anonymous shared mappings yet :(((
> 


That's the question I once asked on c.o.l.d.s.

So, I wrote a wrapper function as below to emulate 
anonymous memory sharing on Linux. 

It works, at least for me, though I don't know whether 
unlink() followed by close() is at all `safe' in this case.
Any comments?

--
    Takeyasu Wakabayashi,
    Faculty of Economics, Toyama University
    [EMAIL PROTECTED]


/***********************************************************************/
/* my_mmap:
 *
 * caddr_t my_mmap(caddr_t addr, size_t len, int prot, 
 *               int flags, int fd, off_t offset)
 *
 * Emulate anonymous memory sharing on Linux.
 * When MAP_SHARED flag is set on FLAGS argument and either MAP_ANON
 * bit is set on FLAGS or FD refers to /dev/zero, emulate anonymous 
 * memory mapping using temporary file, else work as usual Linux mmap().
 *
 * Return pointer to mapped region on success, MAP_FAILED on error.
 * You should check the return value of every call to this function.
 */

#include <sys/types.h>
#include <sys/mman.h>

#ifdef __linux__

#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <stdio.h>

static void err_close(int);
static int is_this_file(int, const char *);


caddr_t my_mmap(caddr_t addr, size_t len, int prot, 
                int flags, int fd, off_t offset)
{
    if ((flags & MAP_SHARED) && 
        ((flags & MAP_ANON) || is_this_file(fd, "/dev/zero"))) {

        char name[L_tmpnam];
        int tmpfd, curmask;
        caddr_t retval;

        if (tmpnam(name) == NULL)
            return MAP_FAILED;

        curmask = umask(0);    /* just in case for foolish umask value */
        if ((tmpfd = open(name, O_RDWR | O_CREAT, 0644)) < 0) {
            umask(curmask);
            return MAP_FAILED;
        }

        if (unlink(name) < 0)
            /* leave the file and continue operation */
            fprintf(stderr, "failed to remove temporary file %s: %s\n", 
                    name, sys_errlist[errno]);
        umask(curmask);

        /* len should be > 0 anyway */
        if (lseek(tmpfd, len - 1, SEEK_SET) == -1) {
            err_close(tmpfd);
            return MAP_FAILED;
        }

        if (write(tmpfd, "", 1) != 1) {
            err_close(tmpfd);
            return MAP_FAILED;
        }

        /* call mmap with flags clear of MAP_ANON bit */
        retval = mmap(addr, len, prot, flags & ~MAP_ANON, tmpfd, offset);

        if (close(tmpfd) < 0)
            /* leave unclosed and return successfully */
            perror("my_mmap: failed to close temporary file");

        return retval;
    }
    return mmap(addr, len, prot, flags, fd, offset);
}


/* 
 * Check whether FD refers to FILENAME. 
 * Only (device, i-node) pairs are checked.
 * There is no way to tell from an open file descriptor 
 * from which directory entry the file is opened or 
 * if it is opened via symlink.
 *
 * Return nonzero if so, zero otherwise.
 */
static int is_this_file(int fd, const char *filename)
{
    struct stat fdinfo, nameinfo;

    if (stat(filename, &nameinfo) || fstat(fd, &fdinfo))
        return 0;

    /* i-node number is not unique ACROSS file systems */
    return ((fdinfo.st_ino == nameinfo.st_ino) && 
            (fdinfo.st_dev == nameinfo.st_dev));
}


/* close FD with care on errno value */
static void err_close(int fd)
{
    /* save original error number */
    int old_err;

    old_err = errno;
    if (close(fd) < 0)
        perror("close failed");
    errno = old_err;
    return;
}


#else /* !__linux__ */


caddr_t my_mmap(caddr_t addr, size_t len, int prot, 
                int flags, int fd, off_t offset)
{
    return mmap(addr, len, prot, flags, fd, offset);
}

#endif /* __linux__ */

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

From: "Ross Crawford" <[EMAIL PROTECTED]>
Subject: Re: 497.2 days ought to be enough for everybody
Date: Sun, 29 Aug 1999 14:31:13 +1000


Ray <[EMAIL PROTECTED]> wrote in message
news:7ptahl$hvu$[EMAIL PROTECTED]...
> Hi,
>
[snip]
> The problem is that I'm about 8000 miles away when /it/ happens. I just
> didn't check before booking the flight :> I don't want to shoot myself
> in the foot and lock myself out /without/ it being the kernel's fault :)
> I will kill all processes which aren't needed and hope that's enough.
> The first box that survived the rollover had lots of tasks running...

Is it possible to organise a shutdown & reboot sometime before you go?
This'd certainly be one option I'd be looking at 8?)

Regards,

ROSCO



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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Crossposted-To: comp.os.linux.alpha,comp.os.linux.development.apps
Subject: Re: Outlook Express
Reply-To: [EMAIL PROTECTED]
Date: Sun, 29 Aug 1999 06:21:51 GMT

On Sun, 29 Aug 1999 04:52:41 GMT, Richard Wilson <[EMAIL PROTECTED]> wrote:
>Sorry but I can't resist asking this because I'm really curious. Why
>would you post a question in three very specific Linux newsgroups
>about a Microsoft Windows application? Why here instead of in one (or
>more) of the microsoft.public.* newsgroups?

It's actually a smart strategy. It often takes a Linux guru to get Windows shit
working. ;)

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

From: Thomas Jaeger <[EMAIL PROTECTED]>
Subject: Help needed: kernel patch problem
Date: Sun, 29 Aug 1999 07:12:49 +0000

Hi Linux friends,

I just noticed, that the latest kernel patches (2.2.xx series and 2.3.xx
series) sometimes
contain the line:

        \No newline at end of file

This line causes the "patch" command to stop immediately. The patch
process for the choosen patch file (e.g. patch-2.2.11) is not completed
and the kernel is not 100% "up to date".

Questions:      What is the reason for the above mentioned line?
                Who inserts the line in the patches?
                How can the line be avoided in the future?
                Who has to remove such lines in the patch files?

Thanks for any help in advance

Thomas Jaeger

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

From: o r c @ p e l l . p o r t l a n d . o r . u s  (david parsons)
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Subject: Re: why not C++?
Date: 28 Aug 1999 00:38:47 -0700

In article <[EMAIL PROTECTED]>,
Cocheese  <[EMAIL PROTECTED]> wrote:

>*Why Is linux done primarily in the C programming language rather than 
>C++?*

   C++ brings nothing to the table when writing a kernel.

                 ____
   david parsons \bi/ Too much C++ experience.
                  \/

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

From: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Subject: Re: why not C++?
Date: Sun, 29 Aug 1999 09:23:53 GMT


Spike! <[EMAIL PROTECTED]> wrote:
>Tristan Wibberley <[EMAIL PROTECTED]> wrote:
>>> BTW, has anyone read Stroustrup's paper where he suggests overloading
>>> the whitespace operator? It's quite an elegant idea, for example
>>> mathematicians would be able to write:
>>>
>>>    v = a x + b y + c z;
>>>
>>> instead of the usual:
>>>   
>>>    v = a * x + b * y + c * z;

Why doesn't it surprise me that Stroustrop came up with this lame idea.
For a man that had the opportunity to clean up the C syntax and make it 
more readable yet managed the impressive task of making it even more of an
dogs dinner than it already was, he really should have learnt his lesson by 
now. I just wish academics like him would crawl back into their ivory towers 
and shut the doors for good since they seem to forget that programming 
languages are tools to be used by people, not machines, and therefor should be 
as syntactically clear as possible, not look like line noise.

NJR   (a C/C++ programmer for 15 years)


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

From: "Marc Elvery" <[EMAIL PROTECTED]>
Subject: Re: Help needed: kernel patch problem
Date: Sun, 29 Aug 1999 11:29:24 +0200


Thomas Jaeger <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Hi Linux friends,
>
> I just noticed, that the latest kernel patches (2.2.xx series and 2.3.xx
> series) sometimes
> contain the line:
>
>         \No newline at end of file
>
> This line causes the "patch" command to stop immediately. The patch
> process for the choosen patch file (e.g. patch-2.2.11) is not completed
> and the kernel is not 100% "up to date".
>
> Questions:      What is the reason for the above mentioned line?
>                 Who inserts the line in the patches?
>                 How can the line be avoided in the future?
>                 Who has to remove such lines in the patch files?
>
> Thanks for any help in advance
>
> Thomas Jaeger

Hi,

you need to have patch-2.5, get it at ftp.gnu.org

Marc




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

From: Bernd Strieder <[EMAIL PROTECTED]>
Subject: Re: how to 'scandisk' in linux
Date: Sun, 29 Aug 1999 11:25:29 +0200

Hi

zackary wrote:
> 
> hello guys
> 
>   I wonder how to check my disk 'health', as in windows'XX' it have
>  'scandisk' to check the bad block, file system and etc. So what should i
>  use to check those things in linux. Would you guys guide me.

This is done during every bootup. Look for messages containing "fsck".
Those appear before the filesystens are mounted into the system for
read/write access. It takes usually a few seconds. Every 20th bootup
(configurable number) or whenever the filesystems had not been unmounted
cleanly during a shutdown some more extensive tests are done. Haven't
you noticed that? I have been using Linux for 4 years now, and I had
never to do a filesystem-check myself, neither something like "defrag"
was necessary. The ext2-Filesystem keeps itself reasonably defragmented
during normal operation.

The ext2-filesystem is very robust in normal operation, I've never
noticed any problems. Problems occur through turning off your box
without a clean shutdown. This is a clear DON'T. Then the filesystems
will be damaged very probably. fsck will manage to repair it in most
cases, but a few files being accessed during the power off might be
unrepairably damaged. So if you never have sudden power offs without
clean shutdowns, you will never have to think about filesystem health.

Bernd.

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

From: [EMAIL PROTECTED] (Erez Zadok)
Crossposted-To: linux.sources.kernel
Subject: Re: Writing my own Filesystem?  Possible?
Date: 29 Aug 1999 06:36:28 -0400

In article <7q98h4$[EMAIL PROTECTED]>,
Christopher Browne <[EMAIL PROTECTED]> wrote:
> On Fri, 27 Aug 1999 21:24:12 -0400, gary huntress <[EMAIL PROTECTED]> wrote:
> >    I would really like to try and write my own filesystem....just to
> >learn...I'm not deluding myself into thinking that I can replace ext2fs
> >:)
> >
> >    I've found a limited amount of older (dated 1996) info documenting
> >ext2fs from the kernel hackers guide and other LDP resources.  I have
> >not been able to find anything that describes changes due to the newer
> >2.2 kernels.
> >
> >    I'd greatly appreciate info/tips/sources/stories about writing a
> >filesystem.   Yes, I *am* reading the source :)   My plan is to extend
> >the ext2fs filesystem to include some sort of encryption, possibly
> >needing some sort of hardware key like http://www.ibutton.com in order
> >to function...I thought that might be interesting.   Yes, I know it
> >would be painfully slow :)
> 
> It would be Real Wise to look to more modern material.
> 
> a) The VFS layer, which you almost certainly would want to use to
> implement a new FS, has been quite greatly in flux since 1996.
> 
> <http://dd-sh.assurdo.com/perlfs/>
> <http://www.inf.bme.hu/~mszeredi/avfs/>
[...]

You can also use my Wrapfs stackable templates for Linux, my papers, and my
updated vfs.txt.  I also have an lofs and cryptfs, implemented as stackable
file systems.

        http://www.cs.columbia.edu/~ezk/research/
amd
        http://www.cs.columbia.edu/~ezk/research/software/

---
Erez Zadok.
Columbia University Department of Computer Science.
EMail: [EMAIL PROTECTED]           Web: http://www.cs.columbia.edu/~ezk
-- 
Erez Zadok.
Columbia University Department of Computer Science.
EMail: [EMAIL PROTECTED]           Web: http://www.cs.columbia.edu/~ezk

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


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