Error: call to ‘__open_too_many_args'

Hi there,
While compiling a makefile on ubuntu 12.04 LTS (64-bit) encountered with this error:

gcc -c -O -DLinux -I /usr/include/readline -I ./inc f_evt.c
In file included from /usr/include/fcntl.h:252:0,
             from ./inc/f_evt.h:10,
             from f_evt.c:43:
  In function �open',
  inlined from �f_evt_put_open' at f_evt.c:738:37:
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:45:26: error: call to  �__open_too_many_args' declared with attribute error: open can be called  either with 2 or 3 arguments, not more
make: *** [f_evt.o] Error 1
f_evt.c: 738: if((ps_chan->l_channel_no=open(c_file,PUT__CRT_FLAG,EF_FILE_ACCE,c_mode))== -1)
 __errordecl (__open_too_many_args,"open can be called either with 2 or 3 arguments, not more");
fcntl2.h:45 : open (const char *__path, int __oflag, ...)
{
  if (__va_arg_pack_len () > 1)
    __open_too_many_args ();

  if (__builtin_constant_p (__oflag))
    {
      if ((__oflag & O_CREAT) != 0 && __va_arg_pack_len () < 1)
    {
      __open_missing_mode ();
      return __open_2 (__path, __oflag);
    }
      return __open_alias (__path, __oflag, __va_arg_pack ());
    }
f_evt.h : 10 : #include <fcntl.h>
 f_evt.c : 43 : #include "f_evt.h"

with the following declarations In function �open':

CHARS c_file[80]; /*Name of file*/ 
#define PUT__CRT_FLAG  O_CREAT|O_RDWR 
#define DEF_FILE_ACCE  S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH  /* rw-r--r-- */ 
CHARS c_mode[80];

How do I fix it? Thanks in advance.

You're not compiling a makefile; you're compiling f_evt.c. The call to open() in f_evt.c on line 738:

open(c_file,PUT__CRT_FLAG,EF_FILE_ACCE,c_mode)

should be changed to:

open(c_file,PUT__CRT_FLAG|EF_FILE_ACCE,c_mode)

Dear Don Cragun,
Thank you for your reply.
I have seen the open function on the line 1230 of this website: web-docs.gsi.de/~go4/go4V02/doxygen/f__evt_8c-source.html please add see that website and let me know your idea.

I have no desire to search the web to find out where you got your code.

You showed us a compilation error and asked how to fix it. I looked at the diagnostics produced by your compiler and told you how to change your code to eliminate that error.

What you do with my suggestion is up to you.

That is some nasty code. It's going to have huge problems if anyone ever tries to compile it 64-bit.

There's a REASON why read() returns ssize_t and NOT int....