Error: call to ‘__open_too_many_args'


 
Thread Tools Search this Thread
Top Forums Programming Error: call to ‘__open_too_many_args'
# 1  
Old 09-26-2014
Error: call to ‘__open_too_many_args'

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

HTML Code:
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
HTML Code:
f_evt.c: 738: if((ps_chan->l_channel_no=open(c_file,PUT__CRT_FLAG,EF_FILE_ACCE,c_mode))== -1)
HTML Code:
 __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 ());
    }
HTML Code:
f_evt.h : 10 : #include <fcntl.h>
HTML Code:
 f_evt.c : 43 : #include "f_evt.h"
with the following declarations In function ‘open':

HTML Code:
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.
# 2  
Old 09-26-2014
You're not compiling a makefile; you're compiling f_evt.c. The call to open() in f_evt.c on line 738:
Code:
open(c_file,PUT__CRT_FLAG,EF_FILE_ACCE,c_mode)

should be changed to:
Code:
open(c_file,PUT__CRT_FLAG|EF_FILE_ACCE,c_mode)

# 3  
Old 09-26-2014
Quote:
Originally Posted by Don Cragun
You're not compiling a makefile; you're compiling f_evt.c. The call to open() in f_evt.c on line 738:
Code:
open(c_file,PUT__CRT_FLAG,EF_FILE_ACCE,c_mode)

should be changed to:
Code:
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.

Last edited by rbatte1; 09-26-2014 at 01:35 PM.. Reason: Converted to URL
# 4  
Old 09-26-2014
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.
# 5  
Old 09-26-2014
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....
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sqlldr call via shell script prompts error

Good morning, I'm attempting to call sqlldr via shell script and it is prompting endIf is unec #!/bin/sh cd /tmp/v_tst FILENAME_WANTED=`date +"HourlyData_%Y%m%d_%H00.txt"` echo "FILENAME_WANTED = ${FILENAME_WANTED}" LIST_OF_FILES=`ls -rt HourlyData*.txt |tail -1` LIST_OF_FILES=`basename... (4 Replies)
Discussion started by: V1l1h1
4 Replies

2. Programming

C: error in wait system call

i made this program but when i compile this code, compiler make this error, is an error on wait() system call but argumenti is right, or not?: esercizio.c:80:9: error: incompatible type for argument 1 of ‘wait' /usr/include/i386-linux-gnu/sys/wait.h:116:16: note: expected ‘__WAIT_STATUS' but... (4 Replies)
Discussion started by: tafazzi87
4 Replies

3. Shell Programming and Scripting

Date Call in Script Error

Hello, Got a simple script: a="Something" b=$(date +"%y%j") c="something else" d="$a$b$c" echo "$d" On running it gives the error: scripty.sh: syntax error at line 2: `b=$' unexpected Can't understand it, any ideas? (3 Replies)
Discussion started by: Damocles
3 Replies

4. Shell Programming and Scripting

error when call function in bash script

Dear all, Could you please advice as I when call function i found the following error " refills: command not found" note that refills is function name. following also the function and how i call it function refills { echo "formatting refills and telepin" >> $log awk -F,... (20 Replies)
Discussion started by: ahmed.gad
20 Replies

5. Web Development

Fatal Error: Call to undefined function imagefilter()

I am using PHP5 in ubuntu 9.10. First I installed PHP and GD as separate package. I tried doing manipulation with images using php image function. When I try using the function imagefilter(), it was not worked and got the solution that need to compile the PHP with the bundled version of GD. So... (0 Replies)
Discussion started by: skg
0 Replies

6. Shell Programming and Scripting

PERL SSH call error

I have a Perl Script #!/usr/local/bin/perl $server_name = "info-xyz-05"; my $value = `/usr/bin/ssh -f $server_name /users/salesadm/MGFINFA/bridgerftpup.sh`; The above calls a shell script on another server called bridgerftpup.sh. This script has several commands and needs to call... (2 Replies)
Discussion started by: alfredo123
2 Replies

7. Shell Programming and Scripting

[Perl] Capture system call error message.

Hi, I googled a bit, but could not find the answer to my problem. But I am sure it is a common issue. I have this code: #!/bin/perl -w #-d use strict; sub remsh_test() { my $host = $_; printf "\n----\n\n"; printf "remsh to $host with system call\n"; my $result = system... (3 Replies)
Discussion started by: ejdv
3 Replies

8. Infrastructure Monitoring

diffrence between method call and function call in perl

Hello, I have a problem with package and name space. require "/Mehran/DSGateEngineLib/general.pl"; use strict; sub System_Status_Main_Service_Status_Intrusion_Prevention { my %idpstatus; my @result; &General_ReadHash("/var/dsg/idp/settings",\%idpstatus); #print... (4 Replies)
Discussion started by: Zaxon
4 Replies

9. UNIX for Advanced & Expert Users

how to differentiate system call from library call

Hi, Ho do I differentiate system call from library call? for example if I am using chmod , how do I find out if it is a system call or library call? Thanks Muru (2 Replies)
Discussion started by: muru
2 Replies
Login or Register to Ask a Question