lkml.org 
[lkml]   [1998]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: a ld_preload to get rvplayer working
Paul wrote:
>
> An easy fix to get RealPlayer working with the development kernels is to
> compile this program as a shared library and LD_PRELOAD it before running
> rvplayer. What it does is turnes off the nonblocking bit for all open()s.
> Works for me using glibc 2.1
>
> #define O_NONBLOCK 04000
> extern int libc_open(const char *, int);
> int open(const char *pathname, int flags)
> {
> if (flags & O_NONBLOCK)
> flags &= ~O_NONBLOCK;
> return(__open(pathname, flags));
> }

Well, something like the following is probably nearer
to what rvplayer intends to do :-)

Tom

#include <string.h>
#include <unistd.h>
#include <fcntlbits.h>

extern int __open(const char *pathname, int flags, mode_t mode);
extern int fcntl(int fd, int cmd, long arg);

int open(const char *pathname, int flags, mode_t mode)
{
int res, rstnblk = flags & O_NONBLOCK && !strcmp(pathname,
"/dev/dsp");

res = __open(pathname, flags, mode);
if (res == -1 || !rstnblk)
return res;
fcntl(res, F_SETFL, fcntl(res, F_GETFL, 0) & ~O_NONBLOCK);
return res;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:45    [W:0.047 / U:1.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site