Ubuntu Suomen keskustelualueet
Ubuntun käyttö => Ohjelmointi, palvelimet ja muu edistyneempi käyttö => Aiheen aloitti: kari_salo - 01.09.09 - klo:09.42
-
Mitenkäs tuo bugi kierretäis?
Ilmenee kun käytetään open() funktiota koodissa.
Ja vain O_CREAT parametrilla.
/usr/include/bits/fcntl2.h:51: error:
call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in second argument needs 3 arguments
Kiitoksia vihjeistä.
-
Moi.
Katos tämä https://wiki.ubuntu.com/CompilerFlags onko mitään apua.
Eli laitan tähänkin jos tuo sivu joskus nurin:
error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT in second argument needs 3 arguments
* When using open() with O_CREAT, best-practice is to define a valid mode argument. For the least modes, try using (S_IRUSR|S_IWUSR) first. If that doesn't work as expected in the program, then start adding back perms. For example, user and group: (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP); user, group, and other: (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH).
Auttaneeko tuo?
-
Kiitosia
Juu,
y = open( x, O_CREAT, S_IWUSR);
menee ainakin kääntäjästä läpi.
Nyt vain koodia testaamaan :)
-
Hyvä juttu! Hauskaa koodausta, varo segfaultteja :)