473,394 Members | 1,802 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Problem with SYS_mount

Hello,

I need to mount a loopback file system. I'm using SYS_mount, but it
always fails with ENOTDIR. Am I doing something silly? Here's the
offending line:

if(syscall(SYS_mount,
"/home/sam/mnt/", "/home/sam/myfile.img", "-o loop" ))
perror("Mount failure/ ");

Thanks.
Jun 27 '08 #1
28 2536
On 5 May 2008 at 21:14, Sam Joseph wrote:
I need to mount a loopback file system. I'm using SYS_mount, but it
always fails with ENOTDIR. Am I doing something silly? Here's the
offending line:

if(syscall(SYS_mount,
"/home/sam/mnt/", "/home/sam/myfile.img", "-o loop" ))
perror("Mount failure/ ");
There are so many problems with your code and approach that it's hard to
know where to begin!

First of all, the prototype for the system call is
asmlinkage long sys_mount(char __user *dev_name, char __user* dir_name,
char __user *type, unsigned long flags, void __user *data);

So your code has the first two arguments the wrong way round, and the
last two arguments are missing. The third argument is, unfortunately,
much too naive: while the mount(8) command is happy to accept options
like "-o loop", the mount system call isn't.

But you shouldn't be using the mount system call at all! The mount
program does some other fairly complicated work besides executing a
system call, and you'd need to re-do all that by hand. Why bother? Just
run mount(8).

If you really want to work programatically, you can open one of the loop
devices, perform an ioctl on it (request LOOP_SET_FD with extra argument
"/home/sam/myfile.img"), then use mount(2).

Jun 27 '08 #2
Antoninus Twink wrote:
On 5 May 2008 at 21:14, Sam Joseph wrote:
>I need to mount a loopback file system. I'm using SYS_mount, but it
always fails with ENOTDIR. Am I doing something silly? Here's the
offending line:

if(syscall(SYS_mount,
"/home/sam/mnt/", "/home/sam/myfile.img", "-o loop" ))
perror("Mount failure/ ");

There are so many problems with your code and approach that it's hard to
know where to begin!

First of all, the prototype for the system call is
asmlinkage long sys_mount(char __user *dev_name, char __user* dir_name,
char __user *type, unsigned long flags, void __user *data);
[...]
Drivel. Nonsense. Idiocy.

To the O.P.: Your question is not about the C language,
but about the system interfaces provided by (it seems) some
flavor of Unix or POSIX. The details of how to get that
system to do something and about the necessary preconditions
and failure modes are all specific to the system, not to the
language you address it with. So look for a forum where the
experts on your system hang out, and try asking there.

Here, as you've seen, you're likely to get drivel,
nonsense, and idiocy.

--
Er*********@sun.com
Jun 27 '08 #3
On 5 May 2008 at 21:47, Eric Sosman wrote:
Antoninus Twink wrote:
>First of all, the prototype for the system call is
asmlinkage long sys_mount(char __user *dev_name, char __user* dir_name,
char __user *type, unsigned long flags, void __user *data);
[...]

Drivel. Nonsense. Idiocy.
What on earth are you talking about? If (as is very likely) the OP is
using Linux, he can check for himself by examining
/usr/src/linux/include/linux/syscalls.h

Jun 27 '08 #4
In article <1210023910.891654@news1nwk>,
Eric Sosman <Er*********@sun.comwrote:
>First of all, the prototype for the system call is
asmlinkage long sys_mount(char __user *dev_name, char __user* dir_name,
char __user *type, unsigned long flags, void __user *data);
[...]
Drivel. Nonsense. Idiocy.
I guess the OP's question concerns Linux, in which case it
would certainly make more sense to ask in a Linux group. But
as far as I can tell, Twink's response was fairly accurate.

-- Richard
--
:wq
Jun 27 '08 #5
In article <1210023910.891654@news1nwk>,
Eric Sosman <Er*********@sun.comwrote a bunch of Drivel. Nonsense. Idiocy.:
....
Here, as you've seen, you're likely to get drivel,
nonsense, and idiocy.

--
Er*********@sun.com
Straight from the source.

Jun 27 '08 #6
Richard Tobin wrote:
In article <1210023910.891654@news1nwk>,
Eric Sosman <Er*********@sun.comwrote:
>>First of all, the prototype for the system call is
asmlinkage long sys_mount(char __user *dev_name, char __user* dir_name,
char __user *type, unsigned long flags, void __user *data);
[...]
> Drivel. Nonsense. Idiocy.

I guess the OP's question concerns Linux, in which case it
would certainly make more sense to ask in a Linux group. But
as far as I can tell, Twink's response was fairly accurate.
That the problem, isn't it? "as far as I can tell" isn't good enough,
post here you might get one opinion, post in the correct place, you will
get informed answers.

--
Ian Collins.
Jun 27 '08 #7
In article <68*************@mid.individual.net>,
Ian Collins <ia******@hotmail.comwrote:
>That the problem, isn't it? "as far as I can tell" isn't good enough,
post here you might get one opinion, post in the correct place, you will
get informed answers.
There's a better chance of accurate answers (and wrong answers being
corrected) in a Linux group, which is why I said it would make more
sense to ask there.

But I was responding to Eric accusation, not to the original poster.
Eric made his accusation here in comp.lang.c, and I don't see why it
should go unchallenged just because he posted it in this newsgroup.

-- Richard
--
:wq
Jun 27 '08 #8
Richard Tobin wrote:
In article <68*************@mid.individual.net>,
Ian Collins <ia******@hotmail.comwrote:
>That the problem, isn't it? "as far as I can tell" isn't good enough,
post here you might get one opinion, post in the correct place, you will
get informed answers.

There's a better chance of accurate answers (and wrong answers being
corrected) in a Linux group, which is why I said it would make more
sense to ask there.

But I was responding to Eric accusation, not to the original poster.
Eric made his accusation here in comp.lang.c, and I don't see why it
should go unchallenged just because he posted it in this newsgroup.
Well in standard C (this is c.l.c, right?) terms,

asmlinkage long sys_mount(char __user *dev_name, char __user* dir_name,
char __user *type, unsigned long flags, void __user *data);

is Drivel. Nonsense. Idiocy!

--
Ian Collins.
Jun 27 '08 #9
In article <68*************@mid.individual.net>,
Ian Collins <ia******@hotmail.comwrote:
>Well in standard C (this is c.l.c, right?) terms,

asmlinkage long sys_mount(char __user *dev_name, char __user* dir_name,
char __user *type, unsigned long flags, void __user *data);

is Drivel. Nonsense. Idiocy!
C&V please. I can't find any of those terms in my copy of the standard.

-- Richard
--
:wq
Jun 27 '08 #10
Richard Tobin wrote:
Eric Sosman <Er*********@sun.comwrote:
>Antoninus Twink wrote:
>>First of all, the prototype for the system call is
asmlinkage long sys_mount(char __user *dev_name, char __user* dir_name,
char __user *type, unsigned long flags, void __user *data);
[...]
> Drivel. Nonsense. Idiocy.

I guess the OP's question concerns Linux, in which case it
would certainly make more sense to ask in a Linux group. But
as far as I can tell, Twink's response was fairly accurate.
I have no idea, since Twink is plonked here. However the question,
and thus an answer to it, are all off-topic for c.l.c. They are
probably topical on a group that deals with the OPs system.

Answering off-topic questions is no way to get off plonk lists.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.

** Posted from http://www.teranews.com **
Jun 27 '08 #11
In article <48**************@yahoo.com>,
CBFalconer <cb********@maineline.netwrote:
>Answering off-topic questions is no way to get off plonk lists.
I am sure Twink will take note of this and act accordingly.

-- Richard
--
:wq
Jun 27 '08 #12
Eric Sosman wrote:

[drivel snipped]
Here, as you've seen, you're likely to get drivel,
nonsense, and idiocy.
You are the best example of that. Your post contains only that

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Jun 27 '08 #13
Ian Collins <ia******@hotmail.comwrites:
Richard Tobin wrote:
>In article <1210023910.891654@news1nwk>,
Eric Sosman <Er*********@sun.comwrote:
>>>First of all, the prototype for the system call is
asmlinkage long sys_mount(char __user *dev_name, char __user* dir_name,
char __user *type, unsigned long flags, void __user *data);
[...]
>> Drivel. Nonsense. Idiocy.

I guess the OP's question concerns Linux, in which case it
would certainly make more sense to ask in a Linux group. But
as far as I can tell, Twink's response was fairly accurate.
That the problem, isn't it? "as far as I can tell" isn't good enough,
Who cares if YOU can tell or not?

He got an accurate answer I can be sure to tell you. You do not know?
Then do not comment I think is best.
Jun 27 '08 #14
In article <fv**********@aioe.org>, jacob navia <ja***@nospam.orgwrote:
>Eric Sosman wrote:

[drivel snipped]
> Here, as you've seen, you're likely to get drivel,
nonsense, and idiocy.

You are the best example of that. Your post contains only that
Indeed. True of Sosman in general.

It was truly satisfying to see him finally come clean about his posting
style.

Jun 27 '08 #15
ga*****@xmission.xmission.com (Kenny McCormack) writes:
In article <fv**********@aioe.org>, jacob navia <ja***@nospam.orgwrote:
>>Eric Sosman wrote:

[drivel snipped]
>> Here, as you've seen, you're likely to get drivel,
nonsense, and idiocy.

You are the best example of that. Your post contains only that

Indeed. True of Sosman in general.

It was truly satisfying to see him finally come clean about his posting
style.
I am a little bit confused as why people are so keen for others not to
answer about things that they are knowing well about in C. Why is this?
I have seen about 5 posters who seems to be wanting not to help more
than they are helping. Very strange behaviours patterns.

Jun 27 '08 #16
On 6 May, 14:50, Eligiusz Narutowicz<eligiuszdotn...@hotmail.com>
wrote:

I am a little bit confused as why people are so keen for others not to
answer about things that they are knowing well about in C.
Because the questions are *not* about C. C is widely used
in a huge variety of situations and those applications
have nothing to do with C the programming language.

For instance C may be used to program anti-lock braking
systems but a discussion of the physics of ALBs though
possibly interesting is not on topic for this ng.

To avoid cluttering the group you should not post OT
stuff.

The reason many people think you should not reply
other than to point to a more relevant ng is that
few people in this group will be experts on the non-topic
stuff.

If someone asks a Linux question someone may give an answer.
It may be wrong. On a Linux group this will be quickly spotted
and corrected. So here is a good place to ask C questions.
It is not a good place to ask about SYS_mount.
Why is this?
I have seen about 5 posters who seems to be wanting not to help more
than they are helping. Very strange behaviours patterns
they are helping they are explaining to the poster where
he should have asked his question.
Do you seek financial or legal advice in a pub?
It's certainly available...

--
Nick Keighley

Jun 27 '08 #17
In article <fv**********@registered.motzarella.org>,
Eligiusz Narutowicz <el*************@hotmail.comwrote:
>I am a little bit confused as why people are so keen for others not to
answer about things that they are knowing well about in C. Why is this?
I have seen about 5 posters who seems to be wanting not to help more
than they are helping. Very strange behaviours patterns.
The things beings answered that you are referring to are *not* C,
they are third party libraries or system-specific functions
that happen to have a C interface. This newsgroup discusses
the C language as specified by one of the various iterations of the
standards -- discusses only that which is doable in un-extended C
and discusses the boundary conditions. It's a big enough topic just
by itself, and bringing in those third party libraries and system
specific functions and discussions of IDEs and what-not drowns out
the discussion of C itself, leading to the departure of the people
who are here to discuss C itself.

The third-party libraries and system functions have other newsgroups
or mailing lists or web sites where they can be discussed in detail
by experts in that functionality, and limitations or mistakes in
the answers noted by other experts. Those other experts are not *here*
so anything authoratative looking will not be cross-checked... and
yes, people *do* make mistakes. For example, in the recent sys_MOUNT
thread you were keen on, the answer you cited as "accurate" was *not*
accurate.

If operating-system specific or third-party libraries become topics
for this newsgroup, then the question arises "Where do you stop?"
Does this become a newsgroup for the discussion of *anything*
that has a C interface (even if the person is programming in, say,
8081 assembler)? They tried that in comp.lang.c++ and it pretty
much killed the newsgroup as a discussion place for C++ itself, I am told.

There a lot of other electronic fora around. This one is just for the
C language itself, not even for details of various implementations of C
(except perhaps the compile flags needed to get the implementation to
act as a conforming C implementation!).
--
"I like to build things, I like to do things. I am having
a lot of fun." -- Walter Chrysler
Jun 27 '08 #18
Eligiusz Narutowicz wrote:
Ian Collins <ia******@hotmail.comwrites:
>Richard Tobin wrote:
>>In article <1210023910.891654@news1nwk>,
Eric Sosman <Er*********@sun.comwrote:

First of all, the prototype for the system call is
asmlinkage long sys_mount(char __user *dev_name, char __user* dir_name,
char __user *type, unsigned long flags, void __user *data);
[...]
Drivel. Nonsense. Idiocy.
I guess the OP's question concerns Linux, in which case it
would certainly make more sense to ask in a Linux group. But
as far as I can tell, Twink's response was fairly accurate.
That the problem, isn't it? "as far as I can tell" isn't good enough,

Who cares if YOU can tell or not?

He got an accurate answer I can be sure to tell you. You do not know?
Then do not comment I think is best.
Congratulations on completely missing my point and snipping the line
that explained it.

--
Ian Collins.
Jun 27 '08 #19
On 6 May 2008 at 14:19, Walter Roberson wrote:
... and yes, people *do* make mistakes. For example, in the recent
sys_MOUNT thread you were keen on, the answer you cited as "accurate"
was *not* accurate.
There was indeed an inaccuracy in my answer, and it would have been a
courtesy to the OP and others reading this discussion if you'd pointed
it out instead of getting on your high-horse.

Specifically, I said:
If you really want to work programatically, you can open one of the
loop devices, perform an ioctl on it (request LOOP_SET_FD with extra
argument "/home/sam/myfile.img"), then use mount(2).
This is wrong: the extra argument should be a file descriptor, not a
path name.

Here's a knock-up example of mounting a file programatically with a loop
device (of course it needs to be run with sufficient privileges to set up
the loop device and mount it).
#include <stdio.h>
#include <errno.h>

#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/mount.h>
#include <linux/loop.h>

#define FILE_TO_MOUNT "/tmp/foo.iso"
#define MOUNT_PATH "/mnt"

int main(int argc, char **argv)
{
char dev[]="/dev/loop0";
int i, fd, fd2;
struct stat statbuf;
struct loop_info loopinfo;

/* find a free loop device */
for(i=0; i<8; i++) {
dev[9]='0'+i;
if( stat (dev, &statbuf) == 0 && S_ISBLK(statbuf.st_mode) )
if((fd = open (dev, O_RDONLY)) >= 0) {
if(ioctl(fd, LOOP_GET_STATUS, &loopinfo) && (errno == ENXIO))
break; /* got one! */
close(fd);
}
fd=-1;
}
if(fd==-1) {
fprintf(stderr, "%s: couldn't find free loop device\n", *argv);
return 1;
}

/* set up the loop device */
if((fd2=open(FILE_TO_MOUNT, O_RDONLY)) < 0) {
fprintf(stderr, "%s: failed to open " FILE_TO_MOUNT "\n", *argv);
return 2;
}

if(ioctl(fd, LOOP_SET_FD, (void *) fd2)) {
fprintf(stderr, "%s: ioctl failed on %s\n", *argv, dev);
return 3;
}

/* do the mount */
if(mount(dev, MOUNT_PATH, "iso9660", MS_RDONLY, NULL)) {
fprintf(stderr, "%s: failed to mount %s on " MOUNT_PATH "\n", *argv, dev);
if (ioctl (fd, LOOP_CLR_FD, 0))
fprintf(stderr, "%s: failed to clear %s\n", *argv, dev);
return 4;
}

/* pause */
printf("Mounted " FILE_TO_MOUNT " at " MOUNT_PATH " using %s\n"
"Press enter to umount...\n", dev);
getchar();

/* do the umount */
if(umount(MOUNT_PATH)) {
fprintf(stderr, "%s: failed to umount %s on " MOUNT_PATH "\n", *argv, dev);
if (ioctl (fd, LOOP_CLR_FD, 0))
fprintf(stderr, "%s: failed to clear %s\n", *argv, dev);
return 5;
}

/* clean up */
close(fd2);
if (ioctl (fd, LOOP_CLR_FD, 0)) {
fprintf(stderr, "%s: failed to clear %s\n", *argv, dev);
return 6;
}
close(fd);

fprintf(stderr, "Umounted %s and cleared %s\n", MOUNT_PATH, dev);
return 0;
}

Jun 27 '08 #20
Eligiusz Narutowicz wrote:
>
.... snip ...
>
I am a little bit confused as why people are so keen for others
not to answer about things that they are knowing well about in C.
Why is this? I have seen about 5 posters who seems to be wanting
not to help more than they are helping. Very strange behaviours
patterns.
It is simple. The topic here is C, as defined in the C standard.
While some users may be experts in other areas, there is no such
guarantee. Thus erroneous answers to non-topical questions may
never be corrected. This is easily avoided by simply placing the
question on a newsgroup where it actually is topical.

This doesn't mean that an off-topic answer is necessarily wrong, as
to fact. However it is wrong as to content, because it encourages
off-topic postings.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
** Posted from http://www.teranews.com **
Jun 27 '08 #21
Brilliant, just what I was looking for! Thanks.

I don't understand the silly squabble that devlopped in this thread -
this is computer world, not an arts subject... there's no gray area,
either something's right (in which case what's the use in saying it's
wrong, when this can be easily checked), or it's wrong (in which case
just correct it).
Antoninus Twink wrote:
On 6 May 2008 at 14:19, Walter Roberson wrote:
>>... and yes, people *do* make mistakes. For example, in the recent
sys_MOUNT thread you were keen on, the answer you cited as "accurate"
was *not* accurate.


There was indeed an inaccuracy in my answer, and it would have been a
courtesy to the OP and others reading this discussion if you'd pointed
it out instead of getting on your high-horse.

Specifically, I said:
>>If you really want to work programatically, you can open one of the
loop devices, perform an ioctl on it (request LOOP_SET_FD with extra
argument "/home/sam/myfile.img"), then use mount(2).


This is wrong: the extra argument should be a file descriptor, not a
path name.

Here's a knock-up example of mounting a file programatically with a loop
device (of course it needs to be run with sufficient privileges to set up
the loop device and mount it).
#include <stdio.h>
#include <errno.h>

#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/mount.h>
#include <linux/loop.h>

#define FILE_TO_MOUNT "/tmp/foo.iso"
#define MOUNT_PATH "/mnt"

int main(int argc, char **argv)
{
char dev[]="/dev/loop0";
int i, fd, fd2;
struct stat statbuf;
struct loop_info loopinfo;

/* find a free loop device */
for(i=0; i<8; i++) {
dev[9]='0'+i;
if( stat (dev, &statbuf) == 0 && S_ISBLK(statbuf.st_mode) )
if((fd = open (dev, O_RDONLY)) >= 0) {
if(ioctl(fd, LOOP_GET_STATUS, &loopinfo) && (errno == ENXIO))
break; /* got one! */
close(fd);
}
fd=-1;
}
if(fd==-1) {
fprintf(stderr, "%s: couldn't find free loop device\n", *argv);
return 1;
}

/* set up the loop device */
if((fd2=open(FILE_TO_MOUNT, O_RDONLY)) < 0) {
fprintf(stderr, "%s: failed to open " FILE_TO_MOUNT "\n", *argv);
return 2;
}

if(ioctl(fd, LOOP_SET_FD, (void *) fd2)) {
fprintf(stderr, "%s: ioctl failed on %s\n", *argv, dev);
return 3;
}

/* do the mount */
if(mount(dev, MOUNT_PATH, "iso9660", MS_RDONLY, NULL)) {
fprintf(stderr, "%s: failed to mount %s on " MOUNT_PATH "\n", *argv, dev);
if (ioctl (fd, LOOP_CLR_FD, 0))
fprintf(stderr, "%s: failed to clear %s\n", *argv, dev);
return 4;
}

/* pause */
printf("Mounted " FILE_TO_MOUNT " at " MOUNT_PATH " using %s\n"
"Press enter to umount...\n", dev);
getchar();

/* do the umount */
if(umount(MOUNT_PATH)) {
fprintf(stderr, "%s: failed to umount %s on " MOUNT_PATH "\n", *argv, dev);
if (ioctl (fd, LOOP_CLR_FD, 0))
fprintf(stderr, "%s: failed to clear %s\n", *argv, dev);
return 5;
}

/* clean up */
close(fd2);
if (ioctl (fd, LOOP_CLR_FD, 0)) {
fprintf(stderr, "%s: failed to clear %s\n", *argv, dev);
return 6;
}
close(fd);

fprintf(stderr, "Umounted %s and cleared %s\n", MOUNT_PATH, dev);
return 0;
}
Jun 27 '08 #22
In article <fv**********@aioe.org>, Sam Joseph <sp******@nospam.comwrote:
>Brilliant, just what I was looking for! Thanks.

I don't understand the silly squabble that devlopped in this thread -
this is computer world, not an arts subject... there's no gray area,
either something's right (in which case what's the use in saying it's
wrong, when this can be easily checked), or it's wrong (in which case
just correct it).
Welcome to CLC!

Bottom line here is: Despite the name, this newsgroup (comp.lang.c) is
not about computers or technology. So, a lot of your basic assumptions
about, as you put it "computer world", do not apply here.

Rather, this is a newsgroup devoted to a particular species of theology.
It is only in the realm of theology that you see people with a deep,
vested interest in believing things that simply aren't so (with a tip of
the hat to Mark Twain). Hence, the endless arguments between the
Establishment (intent on perpetuating the belief in and acceptance of
the theology) and the skeptics (those in the so-called "reality-based
community"). Since there is no resolution to this problem (neither side
is willing to concede any territory), the debate will go on forever.

Jun 27 '08 #23
Ian Collins <ia******@hotmail.comwrites:
Eligiusz Narutowicz wrote:
>Ian Collins <ia******@hotmail.comwrites:
>>Richard Tobin wrote:
In article <1210023910.891654@news1nwk>,
Eric Sosman <Er*********@sun.comwrote:

>First of all, the prototype for the system call is
>asmlinkage long sys_mount(char __user *dev_name, char __user* dir_name,
> char __user *type, unsigned long flags, void __user *data);
>[...]
Drivel. Nonsense. Idiocy.
I guess the OP's question concerns Linux, in which case it
would certainly make more sense to ask in a Linux group. But
as far as I can tell, Twink's response was fairly accurate.

That the problem, isn't it? "as far as I can tell" isn't good enough,

Who cares if YOU can tell or not?

He got an accurate answer I can be sure to tell you. You do not know?
Then do not comment I think is best.

Congratulations on completely missing my point and snipping the line
that explained it.
No. I did not miss your point. It seems you just to be stopping people
answering because you do not understand. This is a C newsgroup. The OP
has an answer. Something to work with.
Jun 27 '08 #24
Eligiusz Narutowicz wrote:
Ian Collins <ia******@hotmail.comwrites:
.... snip ...
>
>Congratulations on completely missing my point and snipping the
line that explained it.

No. I did not miss your point. It seems you just to be stopping
people answering because you do not understand. This is a C
newsgroup. The OP has an answer. Something to work with.
Yes you did. The C language is defined by the C standard, present
and past. Material to do with other things is not topical, unless
the routines to provide those services are also written in purely
standard C and published IN THE MESSAGE. This is a fairly critical
standard, but avoids having the newsgroup go off in all directions,
and system specific newsgroups are generally available for
non-C-topical queries.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
** Posted from http://www.teranews.com **
Jun 27 '08 #25
Sam Joseph wrote:
>
Brilliant, just what I was looking for! Thanks.

I don't understand the silly squabble that devlopped in this thread
- this is computer world, not an arts subject... there's no gray
area, either something's right (in which case what's the use in
saying it's wrong, when this can be easily checked), or it's wrong
(in which case just correct it).
The point is that the group deals with standard C as defined in the
various C standards. Other material is off-topic, and there is no
reason to assume any readers here will (or can) correct it if
erroneous.

Please do not top-post. Your answer belongs after (or intermixed
with) the quoted material to which you reply, after snipping all
irrelevant material. See the following links:

<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://www.caliburn.nl/topposting.html>
<http://www.netmeister.org/news/learn2quote.html>
<http://cfaj.freeshell.org/google/ (taming google)
<http://members.fortunecity.com/nnqweb/ (newusers)

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
** Posted from http://www.teranews.com **
Jun 27 '08 #26
In article <fv**********@aioe.org>, Sam Joseph <sp******@nospam.comwrote:
>I don't understand the silly squabble that devlopped in this thread -
this is computer world, not an arts subject... there's no gray area,
either something's right (in which case what's the use in saying it's
wrong, when this can be easily checked), or it's wrong (in which case
just correct it).
The material provided by Mr. Twink in his or her first reply was
*completely* incorrect on at least 3 systems I have personally had
access to, and my research the other day found that it was incorrect
for at least one of the major branches of Unix. Your
"just correct it" idea would require scowering over several hundreds
of implementations and providing the corrected answer for each of them.

System-specific answers should simply not be provided here, especially
without firm statements of which systems they are specific to.
--
"I want to be remembered as the guy who gave his all whenever
he was on the field." -- Walter Payton
Jun 27 '08 #27
Sam Joseph wrote:
Brilliant, just what I was looking for! Thanks.

I don't understand the silly squabble that devlopped in this thread -
this is computer world, not an arts subject... there's no gray area,
either something's right (in which case what's the use in saying it's
wrong, when this can be easily checked), or it's wrong (in which case
just correct it).
The computer world is a wide one, so to make knowledge
manageable and accessible there must be some amount of
classification and compartmentalization. A useful library
does not just throw all the books onto the shelves helter-
skelter, but groups related volumes together: cooking
here, woodworking there, history through that door on your
left, and so on.

You have found yourself among the shelves that are in
theory devoted to the programming language C, but your
question was not about C. True, it was about a program
fragment expressed in C, but the question was not about C.
(A simple way to see that this is so is to note that from
the point of view of the C language there was nothing at
all wrong with the fragment you posted; whatever problem
you were having was therefore not a C problem but something
else.) You have, as it were, searched the English Grammar
shelves for help assembling your gas grill: the instructions
are in English, but your troubles in executing them have to
do with the leaky fittings and not with English.

Finally, the notion that "there's no gray area, either
something's right [...] or it's wrong" is one you will grow
out of as you gain some experience. Context has more
importance than you give it credit for.

--
Er*********@sun.com
Jun 27 '08 #28
In article <fv**********@canopus.cc.umanitoba.ca>,
Walter Roberson <ro******@ibd.nrc-cnrc.gc.cawrote:
>In article <fv**********@aioe.org>, Sam Joseph <sp******@nospam.comwrote:
>>I don't understand the silly squabble that devlopped in this thread -
this is computer world, not an arts subject... there's no gray area,
either something's right (in which case what's the use in saying it's
wrong, when this can be easily checked), or it's wrong (in which case
just correct it).

The material provided by Mr. Twink in his or her first reply was
*completely* incorrect on at least 3 systems I have personally had
Yeah, I couldn't get it to work on my Nintendo box, either.

Jun 27 '08 #29

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bruce Davis | last post by:
I'm having a problem on windows (both 2000 and XP) with a multi-threaded tkinter gui application. The problem appears to be a deadlock condition when a child thread pops up a Pmw dialog window in...
11
by: Kostatus | last post by:
I have a virtual function in a base class, which is then overwritten by a function of the same name in a publically derived class. When I call the function using a pointer to the derived class...
0
by: Refky Wahib | last post by:
Hi I need Technical Support I finished a Great project using .Net and SQL Server and .Net Mobile Control My Business case is to implement this Program to accept about 1 Million concurrent...
9
by: Sudesh Sawant | last post by:
Hello, We have an application which communicates using remoting. There is a server which is a Windows Service. The server exposes an object which is a singleton. The client is a Web Application...
117
by: Peter Olcott | last post by:
www.halting-problem.com
28
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.