lkml.org 
[lkml]   [2010]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Subjectopendir() on a file???
From
Date
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.




\
 
 \ /
  Last update: 2010-03-09 10:29    [W:0.075 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site