Opened 15 years ago

Last modified 11 months ago

#4929 assigned enhancement

Rename dprintf() to Avoid Clash with the POSIX.1-2008 Function

Reported by: bonefish Owned by: nobody
Priority: normal Milestone: R1.1
Component: System/Kernel Version: R1/alpha1
Keywords: Cc:
Blocked By: Blocking: #15366
Platform: All

Description

POSIX.1-2008 introduces the functions [v]dprintf(). To avoid a name clash when we implement them, the kernel dprintf() should be renamed to debug_printf(). We can continue provide the old symbol for binary compatibility.

Change History (15)

comment:1 by waddlesplash, 9 years ago

Milestone: R1Unscheduled

comment:2 by waddlesplash, 9 years ago

Milestone: UnscheduledR1

Reverting earlier milestone change

comment:3 by axeld, 8 years ago

Owner: changed from axeld to nobody
Status: newassigned

comment:4 by waddlesplash, 6 years ago

Why rename it to "debug_printf" instead of just "printf", anyway?

comment:5 by waddlesplash, 5 years ago

Blocking: 15366 added

comment:6 by X512, 4 years ago

Is it really needed? Kernel is not expected to provide full POSIX support.

comment:7 by waddlesplash, 4 years ago

The problem also applies to libroot.

in reply to:  7 comment:8 by mmlr, 4 years ago

Replying to waddlesplash:

The problem also applies to libroot.

No, in userland it is already called debug_printf and libroot exports the other dprintf(fd, format, ...) from stdio.

Last edited 4 years ago by mmlr (previous) (diff)

comment:9 by pulkomandy, 4 years ago

It's not a "needed" change, but just to avoid confusion by having two different functions in two different places doing different things.

The kernel is of course not implementing the full POSIX API, but we at least try to keep it as close as reasonably possible as it makes development a lot easier and removes a lot of "oh no I'm writing kernel code, I need black magic" feeling by having a subset of the same APIs available.

Version 0, edited 4 years ago by pulkomandy (next)

comment:10 by pulkomandy, 4 years ago

Milestone: R1R1.1

comment:11 by axeld, 15 months ago

It would also be useful to rename the function to easily enable building kernel stuff that uses dprintf() in userland.

comment:12 by axeld, 13 months ago

Anyone else in favor of printf instead of debug_printf?

comment:13 by axeld, 13 months ago

I would stick to debug_printf, as it's already called this way in userland, too.

comment:14 by pulkomandy, 13 months ago

I don't think the name is very important, as long as we avoid confusion with dprintf. Soe if debug_printf is more popular, let's go with that!

comment:15 by waddlesplash, 11 months ago

I would stick to debug_printf, as it's already called this way in userland, too.

But then we'd have a clash between debug_printf() in libroot and debug_printf() in kernelland-emu for tests. At least with printf, the output will go to stdio, rather than to syslog.

Note: See TracTickets for help on using tickets.