instead of cluttering the code with #ifdef's, just define the
non-existing functions as empty dummies when XDMCP is disabled.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Adding a new header for math related functions, beginning with new
MIN/MAX macros, which will be used by subsequent commits.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Adding new source and header that's going to host all DIX
settings (set via cmdline or xf86 config file) in the future.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Certain display managers (for example SDDM) starts X server with
-noreset flag and it is not user configurable. This patch add code to
ignore -noreset and -reset command line arguments to prevent X server
crash due to unknown arguments.
Signed-off-by: Tautvis <gtautvis@gmail.com>
Only internally within OS layer and screen saver logic,
so no need to keep it exported.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Since we're always terminating now, everbody can call UnlockServer()
directly, so we don't need that extra function anymore.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Drop the -reset flag, so Xserver now either simply continues (w/o going
through internal reset) when last client disconnected or terminates
when -terminate is given.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
They're only used inside os/connection.c, so no need to have them
in some header and expose them to other areas.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Move this to a little function (which also has a better name now)
inside the already platform specific ossock.c
Also removing the EMSGSIZE check: we're using TCP or local unix
socket, so EMSGSIZE is never returned.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Yet another very internal function that the proprietary Nvidia driver
is using for unknown reasons.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Not needed by drivers (there aren't any on win32), so no need to
have it in public SDK header.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
It's only used by record extension, not used by any drivers at all
(neither FOSS nor proprietary), so it shouldn't be in the public SDK.
Since it's never been used by any driver, it's effectively no ABI change,
so we can safely do this within ABI-25.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Not used by any external drivers, so no need to keep them in public
SDK headers. Since they're never used by drivers, it's effectively
not an ABI change, so can safely be done within ABI-25.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Not used by any drivers, no no need to keep it in public SDK.
Since it's not used by drivers, it's effectively not an ABI change,
so can be done within ABI-25.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
these symbols aren't used by any external drivers (not even proprietary
Nvidia), so no need to keep them exported any longer:
* present_check_flips
* present_register_complete_notify
* present_can_window_flip
* uint32_t FakeScreenFps
Since it's not any *effective* ABI change, can go into current ABI-25 line.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Only used inside OS layer and xfree86 os-support, so no need to keep
it in public SDK.
Since never used by any drivers, it's not an actual ABI change, so
we can safely do it within ABI-25.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Not exported, not used by any external modules, so no need to have
that declaration in a public SDK header.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
> ../os/Xtranssock.c:494:5: warning: ‘strncpy’ specified bound depends on the length of the source argument [-Wstringop-truncation]
> 494 | strncpy(addr->sa_data, port, portlen);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../os/Xtranssock.c:446:15: note: length computed here
> 446 | portlen = strlen(port) + 1; // include space for trailing null
> | ^~~~~~~~~~~~
Since we already know the string length, we can just use memcpy()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Move the callbacks directly into DIX, since it's actually core infrastructure.
Also simplifying the whole machinery, by just using a simpel CallbackListPtr.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Not used anywhere, so no need to keep it around anymore.
Also dropping the BytesReadable vector, which is unused now.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Existing client-state hook isn't sufficient for this, and so easy to
be extended cleanly (*1). Adding a new callback is trivial and cheap,
so preferring this way, instead of trying to tweak the existing hook
for something it's never been designed for.
*1) see discussion here: https://github.com/X11Libre/xserver/pull/1077
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
arc4random_buf() is a pretty standard libc function on Unix'oid platforms,
but not all our targets have it, thus we need a fallback there. Currently we
have GenerateRandomData(), which either just wraps arc4random_buf() or provides
some fallback implementation.
For those cases it's easier to just implement missing functions directly
instead of having custom wrapper functions. So, drop GenerateRandomData()
in favor of arc4random_buf() and provide fallback implementation for where
it is missing.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
We need to undef this win32 symbol, otherwise it's conflicting with our
`CreateWindow` fields.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
size_t is unsigned, but might have different sizes depending on CPU arch,
so casting it to unsigned long, so we can safely use %ld.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Since everything's running via Writev() methods now, the now unused Write()
methods can all be dropped.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Now that all WriteV() methods are operating on single buffer instead ofiovec's,
we don't need the complicated _XSERVTransWriteV() anymore, but instead can
write directly to the socket/fd.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Since they're only called with a one-element iovec, we can use a single
buffer pointer straight away, thus making it quite the same as the old
Write() methods.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
_XSERVTransWrite() is only intended as frontend, for xtrans consumers to
call in here. And upcoming commits will change that function to call the
Writev() method instead of Write(), so we would end up in infinite
recursing if we'd still it it here.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Refactor _XSERVTransWriteV() to call write() on Unix and instead drop
the WRITEV() macro.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Adding helper safe_strlen() that's also checking for NULL pointer
and returning 0 in this case.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>