### Summary

We have an ansible task using `wait_for` module to wait for network device carrier to be up:
```
wait_for:
  path: "/sys/class/net/{{ device }}/carrier"
  search_regex: "1"
  timeout: 60
```

This no longer works since https://github.com/ansible/ansible/commit/9d4ced1237380051334b54379ff64e45c0341a6d, because `mmap()` is now used instead of `read()`, and it isn't supported by `sysfs` in this case.

Do we really need to use `mmap()`? I imagine it might cause issues with other pseudofilesystems too.

In the meantime, we use a workaround: use grep in a loop instead
```
command:
  cmd: "grep 1 /sys/class/net/{{ device }}/carrier"
timeout: 1
retries: 60
register: carrier
until: carrier is successful
```

### Issue Type

Bug Report

### Component Name

wait_for

### Ansible Version

```console
$ ansible --version
ansible [core 2.13.7]
  config file = None
  configured module search path = ['/Users/rob.muir/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/rob.muir/workspace/trash/build/.env/lib/python3.10/site-packages/ansible
  ansible collection location = /Users/rob.muir/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/rob.muir/workspace/trash/build/.env/bin/ansible
  python version = 3.10.7 (main, Sep 15 2022, 01:50:27) [Clang 12.0.0 (clang-1200.0.32.29)]
  jinja version = 3.0.3
  libyaml = False
```


### Configuration

```console
# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
```


### OS / Environment

Mac OS controller, Centos Stream 9 target

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```
# set device to say, eth0 or whatever is on your computer
wait_for:
  path: "/sys/class/net/{{ device }}/carrier"
  search_regex: "1"
  timeout: 60
```


### Expected Results

Expect wait_for to still work with files in /sys

### Actual Results

```console
The wait_for will fail, only with recent ansible versions, due to the use of mmap()
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
if search.groupdict():
                                        match_groupdict = search.groupdict()
                                    if search.groups():
                                        match_groups = search.groups()
                                    break
                    except IOError:
                        pass
            elif port:
                alt_connect_timeout = math.ceil(_timedelta_total_seconds(end - utcnow()))
                try:
                    s = socket.create_connection((host, port), min(connect_timeout, alt_connect_timeout))
                except Exception:
                    
                    pass
                else:
                    
                    if b_compiled_search_re:
                        b_data = b''
                        matched = False
                        while utcnow() < end:
                            max_timeout = math.ceil(_timedelta_total_seconds(end - utcnow()))
                            readable = select.select([s], [], [], max_timeout)[0]
                            if not readable:
                                
                                
                                continue
                            response = s.recv(1024)
                            if not response:
                                
                                break