All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jon Masters <jonathan@jonmasters.org>
To: LKML <linux-kernel@vger.kernel.org>
Subject: opendir() on a file???
Date: Tue, 09 Mar 2010 04:26:57 -0500	[thread overview]
Message-ID: <1268126817.10479.643.camel@localhost> (raw)

Folks,

Now I might be missing something, and I know I'm behind on LKML[0], but
the following isn't supposed to work in my book:

/*
 * Weird kernel test
 */

#include <sys/types.h>
#include <dirent.h>
#include <stdio.h>

int main(int argc, char **argv)
{
        DIR *dir;

        dir = opendir("foo.conf");

        if (dir)
                printf("WTF?\n");

        return 0;
}

This is on an ext4 filesystem, whereas on a box with an older kernel
this test correctly does not print "WTF?". I know some filesystems
experiment with streams and treating files as directories, etc. but I
wasn't aware that anything particular had changed recently?

The box is running almost an upstream kernel, and I can poke if I'm told
this not intended: 2.6.34-0.8.rc0.git11.fc14.x86_64.

What am I missing?

Jon.

[0] The podcast isn't dead, I'm just suffering from a cold and will be
taking a day off to recover and catch up with that sometime today.



             reply	other threads:[~2010-03-09  9:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-09  9:26 Jon Masters [this message]
2010-03-09 14:59 ` opendir() on a file??? Ulrich Drepper
2010-03-09 16:05   ` Jon Masters
2010-03-09 15:05 ` Florian Mickler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1268126817.10479.643.camel@localhost \
    --to=jonathan@jonmasters.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.